Fix feature_value position backfill during 9.0.0 upgrade - #1818
Conversation
| if (empty(DbWrapper::executeS('SHOW TABLES LIKE "' . _DB_PREFIX_ . 'feature_value"'))) { | ||
| return; | ||
| } |
There was a problem hiding this comment.
It seems not relevant to check for existence of this table, what do you think?
There was a problem hiding this comment.
Yes, you're right, I'll correct it.
There was a problem hiding this comment.
@kpodemski
I removed the checks on both the table and the field because we are sure they exist.
|
@Quetzacoalt91 @kpodemski Should I fix them in this PR? Also, I’m not sure whether targeting the Also, there are errors (example: https://github.com/PrestaShop/autoupgrade/actions/runs/26496496929/job/78025905639?pr=1818) that do not depend on my change, perhaps precisely because I need to change branch? |
|
Yes, can you please target the I've seen your how-to-test field, and can you tell me if that's solving an issue while using the shop? |
340cf4b to
17a106e
Compare
17a106e to
22e4523
Compare
@Quetzacoalt91, I performed the rebase, but I ran into some difficulties, so I had to do a reset and re-add the changes. That's why there's now only one commit, unlike before when there were two, but the final result is the same (the first commit, which was modified by the second, is missing).
Yes, you can see the issue that explains in detail the problem visible in the admin: PrestaShop/PrestaShop#41554 |
|
I've the updated the base branch so the CI does not fail for a missing library |
22e4523 to
be07de0
Compare
|
@Quetzacoalt91 done |
|
ingridusta
left a comment
There was a problem hiding this comment.
Hi @Codencode,
Thanks for the catch !
I reproduced the bug :
And with ur fix :
Thanks ! It's QA approved ✅



When the new
positioncolumn is added tofeature_value, existing rows all receive the default value0, which can cause ordering issues. This change adds a dedicated upgrade step that initializes sequential positions per feature during the9.0.0migration, while avoiding overwriting already-initialized data.2. Upgrade to PrestaShop 9.x.x
3. Check that the position field in the feature_value table is correctly populated and try changing the position of the values in the admin panel.
NOTE
The positions could also have been set using this query:
However, I preferred to create a PHP file for compatibility reasons with different MySQL / MariaDB versions.