-
Notifications
You must be signed in to change notification settings - Fork 118
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
Add a check about PS_VERSION_DB #696
Add a check about PS_VERSION_DB #696
Conversation
6e7f870
to
3972539
Compare
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.
I got just one question about the check condition.
classes/UpgradeSelfCheck.php
Outdated
return version_compare( | ||
Configuration::get('PS_VERSION_DB'), | ||
$this->prestashopConfiguration->getPrestaShopVersion(), | ||
'>=' |
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.
why >= and not == ?
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.
Because if for any reason the version stored in db is above the current PrestaShop, the message displayed asking to run migration files does not make sense. I want to get the message only if the version is below, and "<" is the opposite of ">=".
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.
I changed in favor of ==
following @AureRita checks
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.
Thank you for your PR, I tested it and it show me correctly the error when I have a previous version on PS_Version_DB and not when I have a newest version as you can see :
recording.203.webm
I tested it on
8.0.5, 8.1.6, 1.7.8.10
I try to do an upgrade from 8.0.5 to 8.1.6 with the major release, all seems ok
but when I try to do an upgrade from 1.7.8.10 to 8.1.6 with the major release, I have this error
And when I want to go on the BO :
recording.204.webm
FYI : When I do the upgrade, I put the version 8.1.0 in de PS_Version_DB
Waiting for correction
481e61a
to
5365ad7
Compare
5365ad7
to
10e30e3
Compare
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.
Thank you for your PR, I tested it and it seems to works as you can see :
recording.217.webm
Tested on :
1.7.8.11 (major Upgrade to 8.1.6)
8.0.5 (major Upgrade to 8.1.6)
8.1.5 (Minor Upgrade to 8.1.6)
8.1.6
Because the PR seems to works as expected, It's QA ✔️
Thank you
This PR also removes some duplicated code to get the module version.