Update (07.04.26): for the final solution see #11758 (comment)
Update (31.0326): for the final solution see #11758 (comment)
Valid Title
Description
S. the messages in this issue, from here on: #8866 (comment)
The lib/pkp/lib/regionMapping.php contains fixes for the old region codes. For some regions, the fix cannot be applied twice, because the fixed region code would actually be seen as the code to be fixed, in some cases.
If the job FixRegionCodes fails, it will be re-tried again, which could then lead to invalid region codes in the DB.
Thus, a new solution is needed, that inserts a marker, e.g. a prefix for the codes to be fixed (so that only this entries with the marker are considered for update) and that additionally splits the lines to update into chunks (so that no timeout happens in huge installations).
The new solution uses smaller and chained jobs, that can be re-tried. All the region that needs to be fixed are marked with the prefix 'pkp-'. Then the regions containing the prefix are fixed. The jobs are per country and 100000 rows.
Steps to Reproduce
- Have entries in the DB table metrics_submission_geo_daily and/or metrics_submission_geo_monthly with some of those region codes, e.g.
country = 'KH', region = '09'
- run the FixRegionCodes job
- the region should now be '10'
- run the FixRegionCodes job
- the region is now '11', which is wrong, it should be '10'
Expected Result
After running the job several times the region code should still be correct. From example above: region should be '10'
Actual Result
After running the job several times the region code is wrongly fixed again. From example above: region is '11'
Environment Details
No response
Application Version
OJS, OMP, OPS version >= 3.4
Logs
No response
Additional Information
No response
PRs:
stable-3_4_0:
stable-3_5_0:
Fix 1:
main:
Fix 1:
Update (07.04.26): for the final solution see #11758 (comment)
Update (31.0326): for the final solution see #11758 (comment)
Valid Title
Description
S. the messages in this issue, from here on: #8866 (comment)
The lib/pkp/lib/regionMapping.php contains fixes for the old region codes. For some regions, the fix cannot be applied twice, because the fixed region code would actually be seen as the code to be fixed, in some cases.
If the job FixRegionCodes fails, it will be re-tried again, which could then lead to invalid region codes in the DB.
Thus, a new solution is needed, that inserts a marker, e.g. a prefix for the codes to be fixed (so that only this entries with the marker are considered for update) and that additionally splits the lines to update into chunks (so that no timeout happens in huge installations).
The new solution uses smaller and chained jobs, that can be re-tried. All the region that needs to be fixed are marked with the prefix 'pkp-'. Then the regions containing the prefix are fixed. The jobs are per country and 100000 rows.
Steps to Reproduce
country = 'KH', region = '09'
Expected Result
After running the job several times the region code should still be correct. From example above: region should be '10'
Actual Result
After running the job several times the region code is wrongly fixed again. From example above: region is '11'
Environment Details
No response
Application Version
OJS, OMP, OPS version >= 3.4
Logs
No response
Additional Information
No response
PRs:
stable-3_4_0:
stable-3_5_0:
pkp/pkp-lib#11758 submodule update ojs#5441(only submodule update)Fix 1:
pkp/pkp-lib#11758 submodule update ojs#5475(only submodule update)main:
Fix 1: