Skip to content
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

Merged
merged 2 commits into from
Jun 24, 2024
Merged

OEL-3058: Check strings before deletion. #159

merged 2 commits into from
Jun 24, 2024

Conversation

drishu
Copy link
Contributor

@drishu drishu commented Jun 19, 2024

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

  • Fixed: oe_corporate_blocks_post_update_40010

Comment on lines 341 to 345
$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'],
];
Copy link
Contributor

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.

Copy link
Contributor Author

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.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
$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]);

Copy link
Contributor

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.

Copy link
Contributor Author

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

@brummbar brummbar merged commit f0b6949 into 4.x Jun 24, 2024
1 check passed
@brummbar brummbar deleted the OEL-3058 branch June 24, 2024 14:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants