Problem/Motivation
I was reviewing #3151979: Make allow_insecure_uploads a required variable in system file migrations and this setting is being used to skip the migration if the variable is missing. That's not the usual meaning of required (in the way it is used in modules, config dependencies and migration dependencies). If something is required and it is missing then the system will error not ignore.
This feature was added in #3152789: Add required variables config to Variable migrate source plugin, and if one of those are missing, return zero rows
Proposed resolution
Come up with a better name. The other important thing is that if any of these variables are missing then we return an empty row no row.
Rename variables_required to variables_no_row_if_missing
Remaining tasks
User interface changes
API changes
Data model changes
Release notes snippet
| Comment | File | Size | Author |
|---|---|---|---|
| #4 | 3182891-4.patch | 7.59 KB | alexpott |
Comments
Comment #2
alexpott@mikelutz pointed out that it is not an empty row - it's no row... updated options accordingly.
Comment #3
alexpottI don't think the any is important for the no_row option.
Comment #4
alexpottDiscussed with @catch. We settled on
variables_no_row_if_missingComment #5
alexpottThe optionalVariables property is never used. Having a variable named like this is confusing so I've removed it.
Comment #6
catch#4 looks good. I found the issue title confusing for the original issue, but then when reading the patch it all fell into place. But someone else having the same reaction to the variables_required when seeing it for the first time confirms I should've held onto that initial feeling. Since this hasn't been in a stable release it seems least impact to just rename it asap.
Comment #7
mikelutzWhile I never had a problem with variables_required, I can understand the confusion around it, and have no objection to a naming change. We need a new Change Record, or we need to update the original at https://www.drupal.org/node/3174294
Comment #10
catchCommitted/pushed to 9.2.x and cherry-picked to 9.1.x, thanks!
Comment #11
wim leers#7: Done: https://www.drupal.org/node/3174294 — diff at https://www.drupal.org/node/3174294/revisions/view/12112670/12128176