-
-
Notifications
You must be signed in to change notification settings - Fork 824
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
dev/translation#4 - Refine upgrade steps for modifying nl_NL #17048
Conversation
The `interpolate()` function is already available as the heart of `CRM_Util_SQL_Insert` and `CRM_Utils_SQL_Select`, etc. This just makes it easier to use for random SQL statements that don't have a full OOP model.
1. This adds a filter on `option_group_id` so that we don't modify unrelated OGs/OVs 2. Use simpler SQL semantics per https://docs.civicrm.org/dev/en/latest/framework/upgrade/#tips-prefer-simple-sql-semantics-over-apibaodao
(Standard links)
|
\Civi\Api4\OptionValue::update() | ||
->addWhere('name', '=', 'nl_NL') | ||
// Adding check against label in case they've customized it, in which | ||
$sql = CRM_Utils_SQL::interpolate('UPDATE civicrm_option_value SET label = @newLabel WHERE option_group_id = #group AND name = @name AND label IN (@oldLabels)', [ |
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.
Maybe a silly question: Where is the interpolate function?
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.
Oh I see - it's part of this patch.
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.
Yeah, the function was originally two lines and then got a little longer for silly reasons.
I could break it out into a separate PR if that seems tidier.
|
merging based on @demeritcowboy review |
Overview
This refines the upgrader step added in #17027.
CC @demeritcowboy @seamuslee001
Before
option_group_id
filterAfter
option_group_id
filter