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
Null values in assoc columns in user_settings prevent correct data reading after update #7167
Comments
Just adding notes from my other issue: Identification SELECT s.user_id, s.setting_name, s.locale
FROM user_settings s
GROUP BY user_id, setting_name, locale
HAVING COUNT(0) > 1 Variations Possible source Solution
|
@asmecher before I touch this, follow some questions:
|
@jonasraoni, yes, the 3.4.0 ( |
Just for reference, in case someone land here, here's a query to fix the issue while I didn't start working on this: |
…and the removal of deprecated fields in user_settings
…and the removal of deprecated fields in user_settings
…and the removal of deprecated fields in user_settings
Looks like the PRs for /main: |
…pped implicitly)
…ey constraint to avoid conflicts
…ey constraint to avoid conflicts
…and the removal of deprecated fields in user_settings
…and the removal of deprecated fields in user_settings
…and the removal of deprecated fields in user_settings
Summary:
|
Reopening due to this error I found in one of the upgrade tests: https://app.travis-ci.com/github/pkp/ojs/jobs/556609009 |
…igration-script##
…igration-script##
…igration-script##
…igration-script##
…igration-script##
…igration-script##
…on-script #7167 Fixed migration script
…on-script pkp/pkp-lib#7167 Fix migration script
…on-script pkp/pkp-lib#7167 Fix migration script
…n-script pkp/pkp-lib#7167 Fixed migration script
Done! Here's the explanation/cause: #7670 |
Describe the bug
The bug described on the forum: https://forum.pkp.sfu.ca/t/null-values-in-user-settings-safe-to-remove/68272
Old installations may have NULL values in
assoc_type
andassoc_id
columns inuser_settings
table. This leads to duplicated rows when this data is updated, e.g. through the user profile form:According to the report, this leads to problems in reading user data, the one that I can reproduce appears in Add Reviewer form: searching for a reviewer gives duplicated entries of this particular user in example:
Also, during data retrieval, old setting value, e.g.
Doe
may be displayed instead ofNewDoe
. This one I wasn't able to reproduceTo Reproduce
At glance, this problem affects old installs and I'm unable to reproduce it on a clean instance. I can confirm that my old test instance upgraded from 3.0 is affected.
What application are you using?
OJS 3.3
Additional information
I think to solve the issue the best would be to add an upgrade script that removes duplicates (those with
0
are newer and should remain intact while rows withNULL
should be removed) or replacesNULL
values with the default0
s if the row isn't duplicated.Associated issue: #7146
The text was updated successfully, but these errors were encountered: