New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Prevent undefined id_module error on Modules page #8463
Conversation
Thanks for this PR @kpodemski. All modules registered to a hook must be installed, thus must have an ID. I don't really understand how that case could happen. |
PrestaShop upgrade, modules which causes this error are installed, this is why it's weird, however i have not noticed any downsides after this change, everything is working as expected |
Hmm can we log something in case the module id doesnt exists? I'm never in favor of hidding a possible real issue. |
Is there an easy way to add to the log without adding the Logger? Something with @trigger_error()? |
I don't think that PrestaShop has any other method to log errors than Logger? unless there's something from Symfony, dunno btw. i'm not sure what is the purpose of LegacyHookSubscriber on Modules page in the first place :) |
The Logger is actually a service from Symfony. But I guess this is an extreme change just for that case (furthermore, we are in a static context). |
Oh, yes, i was writing about PrestaShopLogger, haven't use symfony one yet You know, from what i saw a lot of modules cause errors, dashtrends, pm_advancedtopmenu and few others, i think that there's some logic issue with entire LegacyHookSubscriber idea on Modules page as those modules are working fine... |
Okay, let's make it simple first. |
@Quetzacoalt91 this would log notice on every request, not sure if that's a good idea, after over 6 months of running store on production (a big store) i couldn't find any downsides of having this change in code |
issue was hook with an empty name in database, fix from this PR doesn't work fully, we need to check this earlier:
could you try to add hook into database with an empty name and check on your side if you have this notice with debug mode enabled? |
Hi @kpodemski, I reproduce the issue, but it seems the issue is worse than we could expect. Added an empty hook, which is stored with the ID 248 in my example.
|
Is #13711 a better fix for this issue? |
@Quetzacoalt91 yes, this seems to fix issue entirely |
This change is