Jump to content

remove smarty -> assign from controller through override (PS 1.5)


defuzed

Recommended Posts

I modified the default prestashop 1.5 newsletter module and made the following override of to the IdentityController

 

$this->context->smarty->assign('newsletter', (int)Module::getInstanceByName('berlindisplaynewsletter')->active);

 

So the checkbox would appear to set/unset newsletter subscription via the "my personal information" account link.

Everything works fine but with ini_set("display_errors", 1); i still get the following php error on the personal info page

 

Notice: Trying to get property of non-object in /var/www/prestashop/controllers/front/IdentityController.php on line 135 Call Stack: 0.0001 646712 1.

 

line 135 of IdentityController.php is

 

$this->context->smarty->assign('newsletter', (int)Module::getInstanceByName('blocknewsletter')->active);

 

When i comment out the line, the error goes away, but I really don't want to mess with the core files, can anyone tell me how to "unset" this variable through the override file?

Link to comment
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...