Page 1 of 1

default language

Posted: Fri Sep 02, 2022 10:09 am
by Omar_one
Hello,
I am trying to override the language.php and save it on includes/system/override/
because we need to change get_browser_language to get the default language

Code: Select all

    public function get_browser_language() {
      trigger_error('The get_browser_language function has been deprecated.', E_USER_DEPRECATED);
      $this->language = $this->catalog_languages[static::negotiate($this->catalog_languages)];
    }
to this

Code: Select all

 public function get_browser_language() {
      trigger_error('The get_browser_language function has been deprecated.', E_USER_DEPRECATED);
      $this->language = $this->catalog_languages[DEFAULT_LANGUAGE];
    }
the shop side working well, but the admin not working got error (HTTP ERROR 500)
and on the log_file

Code: Select all

PHP Fatal error:  Uncaught Error: Call to undefined method language::load_all() in /home/test/public_html/admin/attributeManager/attributeManager.php:94
Stack trace:
#0 {main}
  thrown in /home/test/public_html/admin/attributeManager/attributeManager.php on line 94
PHP Fatal error:  Uncaught Error: Call to undefined method language::load_all() in /home/test/public_html/admin/includes/actions/catalog/update_product.php:42
Stack trace:
#0 /home/test/public_html/admin/includes/segments/process_action.php(19): require()
#1 /home/test/public_html/admin/catalog.php(32): require('/home/test/p...')
#2 {main}
  thrown in /home/test/public_html/admin/includes/actions/catalog/update_product.php on line 42
PHP Fatal error:  Uncaught Error: Call to undefined method language::load_all() in /home/test/public_html/admin/includes/actions/catalog/views/new_product.php:236
Stack trace:
#0 /home/test/public_html/admin/catalog.php(48): require()
#1 {main}
  thrown in /home/test/public_html/admin/includes/actions/catalog/views/new_product.php on line 236
PHP Fatal error:  Uncaught Error: Call to undefined method language::load_all() in /home/test/public_html/admin/login.php:27
Stack trace:
#0 {main}
PHP Fatal error:  Uncaught Error: Call to undefined method language::load_all() in /home/test/public_html/admin/login.php:27
Stack trace:
#0 {main}
  thrown in /home/test/public_html/admin/login.php on line 27
PHP Notice:  Trying to access array offset on value of type null in /home/test/public_html/includes/hooks/admin/siteWide/aMenu.php on line 61
PHP Notice:  Trying to access array offset on value of type null in /home/test/public_html/includes/hooks/admin/siteWide/aMenu.php on line 19
PHP Fatal error:  Uncaught Error: Call to undefined method language::load_all() in /home/test/public_html/admin/login.php:27
Stack trace:
#0 {main}
  thrown in /home/test/public_html/admin/login.php on line 27
thank you in advance for your help
Omar

Re: default language

Posted: Fri Sep 02, 2022 12:46 pm
by ecartz
Does your overridden version have a load_all function?

To fix admin, you might copy the one from includes/system/versioned (not override) to admin/includes/classes/

Re: default language

Posted: Fri Sep 02, 2022 2:44 pm
by Omar_one
ecartz wrote: Fri Sep 02, 2022 12:46 pm Does your overridden version have a load_all function?
yes it have all load_all function, same language.php as original just edited the function get_browser_language ,, the rest same ,,
ecartz wrote: Fri Sep 02, 2022 12:46 pm To fix admin, you might copy the one from includes/system/versioned (not override) to admin/includes/classes/
thank you this fix the issue