Hi, I have php issues display when i connect to my backoffice. Here are the error messages:
Notice 脿 la ligne 227 du fichier /home/www/modules/psaddonsconnect/psaddonsconnect.php
[8] Undefined variable: advice
Notice 脿 la ligne 228 du fichier /home/www/modules/psaddonsconnect/psaddonsconnect.php
[8] Undefined variable: link_advice
Can you help to fix that please?
This is the lines on the file:
Line227: 'advice' => $advice,
Line228: 'link_advice' => $link_advice,
Additionnal information
PrestaShop version: 1.7.3.0
PHP version: 7.1.21
Th猫me actif : classic
Thank you for your reply and help
Hi @Marwazeinoo88,
I manage to reproduce this issue.
When I access the BO, the red alert is displayed.
This issue is randomly.
Reported here: http://forge.prestashop.com/browse/BOOM-5781
Thanks!
So for now, i should just rename the folder "psaddonsconnect" (in www/modules/)?
@Marwazeinoo88, you can navigate to your BO => IMPROVE => Modules => Modules & Services => search for this module & disable it.
Thanks!
okey, Thank you for your reply and help
I just had the same problem with 1.7.4.
Hi @masiorama,
Have you tried to disable the psaddonsconnect module?
PS: this issue is added to our bug roadmap, it is not fixed yet.
Thanks!
I did @khouloudbelguith , and that specific error on login disappeared. Still today I'm experiencing so many difficulties with prestashop, expecially in getting modules updates... does it mean anything to you?
Thanks in advance.
@masiorama, This issue is a different issue, can you open a new one with more information about your configuration & your different issue.
Thanks!
Ok thanks I'll try to gather infos and open an issue... I'm kinda lost anyway, it seems everything random, I'll do the best I can.
@khouloudbelguith just a brief update: during the last 3 days the problem was simply gone, so I don't see a reason to investigate more in depth. I'm pretty sure it was because of some problem with PS sending infos about modules updates, plus maybe my server behavior (which was pretty slow). We managed to upgrade to a different server and now everything seems solid. I will definitely open an issue in case I'll find mysql involved in this problem again. Thanks.
Hello Guys,
PS version: 1.6.1.23
Just encountered this issue today. I believed it is a Prestashop bug, the error is a connection from Prestashop server. It prompt's an error in the dashboard because some of the variables has no values the $advice and the $link_advice.
So this is my quick fix for the issue while Prestashop haven't provide any fix for it.
Hope this helps.
Cheers!
Hi everyone,
I have the same problem too.
I have this configuration:
I have always connected to the BO side without any difficulty but since yesterday I do not access any more.
I can enter user and password but then a page appears with:
PHP Notice: Undefined variable: advice in C:\inetpub\wwwroot\modulespsaddonsconnectpsaddonsconnect.php on line 227
PHP Notice: Undefined variable: link_advice in C:\inetpub\wwwroot\modulespsaddonsconnectpsaddonsconnect.php on line 228
If I insert the code suggested by jomdacillo now I can log in.
But now if I want disable the psaddonsconnect module, what can I search on PrestaShop Addons Marketplace? (if i look for psaddonsconnect it finds nothing)
Kind regards
Create file /override/modules/psaddonsconnect/psaddonsconnect.php with content:
<?php
class PsaddonsconnectOverride extends Psaddonsconnect
{
/**
* @param array $params
* @return string
* @throws SmartyException
*/
public function hookDashboardZoneOne($params)
{
$this->loadAsset();
$url = "";
$logged_on_addons17 = 0;
if ((bool)version_compare(_PS_VERSION_, '1.7', '>=')) {
global $kernel;
//router to get the addons URL
$instance = $kernel->getContainer();
$router = $instance->get('router');
$url = $router->generate('admin_addons_login');
if (isset($_COOKIE['username_addons'])) {
$logged_on_addons17 = 1;
}
}
// API DATA
include_once(_PS_MODULE_DIR_ . 'psaddonsconnect/classes/WeekAdvice.php');
$api = new WeekAdvice();
$api_json = $api->getWeekData();
if (!empty($api_json)) {
$advice = $api_json->advice;
$link_advice = $api_json->link;
}
// assign var to smarty
$this->context->smarty->assign(array(
'img_path' => $this->img_path,
'ps_version' => (bool)version_compare(_PS_VERSION_, '1.7', '>='),
'advice' => isset($advice) ? $advice : null,
'link_advice' => isset($link_advice) ? $link_advice : null,
'url_connexion' => $url,
'logged_on_addons17' => $logged_on_addons17,
'practical_links' => $this->practicalLinks(),
));
$this->output .= $this->context->smarty->fetch(
$this->local_path . 'views/templates/hook/dashboard_zone_one.tpl'
);
return $this->output;
}
}
and remove files:
/var/cache/dev/class_index.php
/var/cache/prod/class_index.php
Hi,
I had to disable the module for the bad way: changing directory name.
But no more error notice on sign in
Hope I helped.
I am facing the same issue on 1.7.5.1 version of Prestashop. I am guessing I got this issue after I clicked on the google link showed in below image.
I am now not able to go to Module Catalog and when I click on Module Manager it gives me internal error 500
Hope this helps someone.
Hey Guys! I enabled debug mode from the BO and tried accessing Module Manager again and this time I get exception details related to another plugin (https://github.com/cashfree/).
Here are few things that are important.
P.S. None of the above solution worked for me, probably because the issue was from CashFree.
The notices have been fixed with the v2.0.0 of the module which was released today. Thanks for the report.
Sorry for disturbing a closed issue. This still happens in prestashop 1.7.6.
Hi @arafatx,
This issue is fixed in the psaddonsconnect
module v2.0.0.
In my case it is ok.
Thanks!
@khouloudbelguith I'm using v2.0.0. Strange behaviour is, when I put prestashop into sub domain with the same setup it works:
www.mywebsite.com - got error
dev.mywebsite.com - no error
Same setup files clone from github. Maybe this happen with specific domain ?
Hi, sorry for making everybody panic. It was the cache issue! Problem solved! Thanks a lot.
@arafatx, Try to access to this link: www.mywebsite.com/modules/psaddonsconnect/config.xml & check the version of this module.
Thanks!
@arafatx, great!
Thanks!
Sorry for commenting on the closed issue but I don't think this issue is fixed and related to cache. I got the same error again on the latest 1.7.6.1 (production). This happen randomly and I guess @jomdacillo is right this issue perhaps related to prestashop server. If i rename or remove the psaddonsconnect there is no problem connecting to Back Office.
Hi @arafatx,
The notices have been fixed with the v2.0.0 of the module psaddonsconnect.
The last release of this module is v2.1.0.
Thanks!
I guess this is random. I just went away from my PC and coming back (refresh the back office page) and it works. Didn't do anything.
@arafatx, since the upgrade of the module psaddonsconnect
, this issue doesn't occur in my case.
Could you please navigate to your BO => Module Manager page & search for the psaddonsconnect
& check the exact version.
Thanks!
The exact same version 2.1.0. I thought the error message was the same (sorry for this. This might be different issue related to CacheStorage):
I only got this error when navigating to BO -> Dashboard.
Perhaps, I should open a new issue? Sorry and TQ.
PS 1.7.6.1
@arafatx, This issue is currently closed & it seems different, can you open a new one with more information about your configuration
Thanks!
Most helpful comment
Hello Guys,
PS version: 1.6.1.23
Just encountered this issue today. I believed it is a Prestashop bug, the error is a connection from Prestashop server. It prompt's an error in the dashboard because some of the variables has no values the $advice and the $link_advice.
So this is my quick fix for the issue while Prestashop haven't provide any fix for it.
Hope this helps.
Cheers!