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
Stop using deprecated hook #32
Conversation
The hook "createAccount" is deprecated, please use "actionCustomerAccountAdd" instead in module "statsdata".
Hello @metacreo It makes sense, but you'd need to unregister the old hook, and register the new one in the upgrade file like this: The next version will be 2.1.2 |
What would happen if a 1.7 user were to upgrade to this? Do your changes have to be made sensitive to pre-PS8 users? |
@watou I tested on 1.7.8.10. Nothing bad. Module steel work. |
That's great! My only point was, is the version of PrestaShop that introduced the |
I am dragging my resource from the 1.6.1.24 branch with all the modules and my own modules. |
Looking further it appears it's only a PrestaShop 8 issue that the deprecated notice is printed when hook aliases are used, so your change to set the min PS version to 1.7.8.10 is not needed. Your previous code change should be good for all PS versions since 1.5. |
Basically this is good; should have gotten rid of aliases earlier. Moreover, now there is a description of hooks in the docs. |
Where are the steps to reproduce ? |
To reproduce this need read top of this page. ;) |
I don't have the error "Got error 'PHP message: PHP Deprecated: The hook "createAccount" is deprecated, please use "actionCustomerAccountAdd" instead in module "statsdata"." in my log file. |
@florine2623 Nice. What PHP version you use? What is value of 'error_reporting' param in your php.ini file? Have you professional php config or just as is? If you not see deprecation error it means your php not configured to show it or php version is older. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @metacreo, the change is legit, we can merge this. :-) I checked the lowest supported version in this module - 1.7.1.0 and there is already the new hook in that core version.
I also updated the description and PR name.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hello @metacreo ,
I tested your PR.
What PHP version you use? What is value of 'error_reporting' param in your php.ini file? Have you professional php config or just as is?
I'm using PHP 8.1.13
.
In my php.ini
file, I haven't changed anything. I'm using my localhost to test. Here's what I have :
error_reporting = MAMP_error_reporting_MAMP
Update to 2.1.2 is successful✅
But here's what I have hooked to the module statsdata :
It is not what's expected from the PR.
I have cleared cache from browser and PS.
Am I doing something wrong ? 😭
@florine2623 Hello, You are using MAMP, which has never been used on production servers. This is extremely unprofessional. Production servers usually run on Linux with PHP-FPM. "In my php.ini file, I haven't changed anything.", "Am I doing something wrong ?"
For testing you must use Hooks not changed, because you need clean PS cache before update module. function upgrade_module_2_1_2 not works because in fact you install same module 2.1.1 from ps repo. |
@florine2623 After update check ps_module table. Last record must be statsdata 1 2.1.2 |
@metacreo Error reporting levels is overridem from the app side. @florine2623 has the environment correctly set. And also, it shoud NOT be required to delete cache before upgrading, it has to work. @florine2623 I had some issues with upgrading modules, could you try it on 8.1.3, so we know if it's a core issue? :-) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thanks @metacreo |
In DEV mode only ... with true PS_DISPLAY_COMPATIBILITY_WARNING
It required to delete cache before upgrading if you want manually init update from update TAB |
Example of errors