cnpark70 Posted August 21, 2015 Share Posted August 21, 2015 I just updated customer privacy block and now I get this error when I click on Module in back office. I cannot access Module anymore. I am on version 1.6.1.1 with default-bootstrap theme. Anyone else having same issue and solved, please share. Thank you in advance. Fatal error: Using $this when not in object context in /home/cnpark70/public_html/modules/blockcustomerprivacy/upgrade/install-2.0.0.php on line 10[PrestaShop] Fatal error in module file :/home/cnpark70/public_html/modules/blockcustomerprivacy/upgrade/install-2.0.0.php:Using $this when not in object context And below is the content of install-2.0.0.php file that's making fatal error in line 10 <?php if (!defined('_PS_VERSION_')) exit; function upgrade_module_2_0_0($object) { $return = true; $return &= $this->registerHook('displayCustomerIdentityForm'); $return &= $this->unregisterHook('header'); $langs = Language::getLanguages(false); $old_messages = array(); foreach ($langs as $l) $old_messages[$l['id_lang']] = Configuration::get('CUSTPRIV_MESSAGE', $l['id_lang']); Configuration::updateValue('CUSTPRIV_MESSAGE', $old_messages); Configuration::updateValue('CUSTPRIV_MESSAGE', $old_messages); return $return; } Link to comment Share on other sites More sharing options...
mapadesing Posted August 21, 2015 Share Posted August 21, 2015 I just go in modules and delete folder blockcustomerprivacy. Working and waiting for some update Link to comment Share on other sites More sharing options...
cnpark70 Posted August 24, 2015 Author Share Posted August 24, 2015 Thanks that worked. Link to comment Share on other sites More sharing options...
google.al Posted November 3, 2015 Share Posted November 3, 2015 I just updated customer privacy block and now I get this error when I click on Module in back office. I cannot access Module anymore. I am on version 1.6.1.1 with default-bootstrap theme. Anyone else having same issue and solved, please share. Thank you in advance. Fatal error: Using $this when not in object context in /home/cnpark70/public_html/modules/blockcustomerprivacy/upgrade/install-2.0.0.php on line 10 [PrestaShop] Fatal error in module file :/home/cnpark70/public_html/modules/blockcustomerprivacy/upgrade/install-2.0.0.php: Using $this when not in object context And below is the content of install-2.0.0.php file that's making fatal error in line 10 <?php if (!defined('_PS_VERSION_')) exit; function upgrade_module_2_0_0($object) { $return = true; $return &= $this->registerHook('displayCustomerIdentityForm'); $return &= $this->unregisterHook('header'); $langs = Language::getLanguages(false); $old_messages = array(); foreach ($langs as $l) $old_messages[$l['id_lang']] = Configuration::get('CUSTPRIV_MESSAGE', $l['id_lang']); Configuration::updateValue('CUSTPRIV_MESSAGE', $old_messages); Configuration::updateValue('CUSTPRIV_MESSAGE', $old_messages); return $return; } Replace this 2 rows: $return &= $this->registerHook('displayCustomerIdentityForm'); $return &= $this->unregisterHook('header'); with this: return ($object->registerHook('displayCustomerIdentityForm')); return ($object->unregisterHook('header')); and the update should continue fine. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now