-
Notifications
You must be signed in to change notification settings - Fork 7
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
OEL-3058: Check strings before deletion. #159
Conversation
oe_corporate_blocks.post_update.php
Outdated
$strings = [ | ||
['source' => 'Search all EU institutions and bodies'], | ||
['source' => 'EU institutions and bodies'], | ||
['source' => 'https://european-union.europa.eu/institutions-law-budget/institutions-and-bodies/search-all-eu-institutions-and-bodies_en'], | ||
]; |
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.
The 'source' key can be dropped and we keep just the value.
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.
Not if we use StringDatabaseStorage, the keys of the arrays must match fields in the db table (lid, source, context, version), and it must be an array of conditions.
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.
$strings = [ | |
['source' => 'Search all EU institutions and bodies'], | |
['source' => 'EU institutions and bodies'], | |
['source' => 'https://european-union.europa.eu/institutions-law-budget/institutions-and-bodies/search-all-eu-institutions-and-bodies_en'], | |
]; | |
$strings = [ | |
'Search all EU institutions and bodies', | |
'EU institutions and bodies', | |
'https://european-union.europa.eu/institutions-law-budget/institutions-and-bodies/search-all-eu-institutions-and-bodies_en', | |
]; |
and then
$string = $storage->findString(['source' => $string]);
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.
Let's also take the chance to rename $strings to $sources.
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.
clear enough, I misunderstood the first time
OEL-3058
Description
Websites other than ewpp may not have the strings, so when the local storage tries to fetch them the result will be null.
reported also in #158
Change log