default language

Open to all! Ask other shopowners for help.
Post Reply
Omar_one
Senior Contributor
Posts: 679
Joined: Fri Oct 25, 2019 5:06 pm
Phoenix Version: v1.0.8.16
Has thanked: 100 times
Been thanked: 56 times

default language

Post 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


Join The Code Co-op to get access to your library in the Code Co-op Forum
ecartz
Core Team
Posts: 3084
Joined: Tue Nov 05, 2019 6:02 pm
Phoenix Version:
Has thanked: 4 times
Been thanked: 208 times

Re: default language

Post 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/
Omar_one
Senior Contributor
Posts: 679
Joined: Fri Oct 25, 2019 5:06 pm
Phoenix Version: v1.0.8.16
Has thanked: 100 times
Been thanked: 56 times

Re: default language

Post 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


Join The Code Co-op to get access to your library in the Code Co-op Forum
Post Reply