FiveSixtyTwo - Fix upgrade for domains with default value of enable_components
#27075
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Overview
v5.62 changes the data-storage for the list of active components -- previously, it was only a setting (
enable_components
); now , it is both a setting and a placeholder extension (civicrm_extension
). This fixes a bug in upgrading sites with a default value ofenable_components
.cc @mlutfy @larssandergreen
Steps to Reproduce
enable_components
(i.e.cv vdel enable_components
)civicrm_setting
forenable_components
. Consequently, the site inherits the default value ofenable_components
.Before
The upgrade encounters issues like this:
On my local system, this issues were fatal. But I can imagine other configurations where they might skipped. If I fix only the warnings, then the end-result is that the upgrade will execute and leave the system without any active components.
This can be seen with:
After
The upgrader completes. The default components are enabled.
Technical Details
For testing, I used my local
dmaster
and prepared two DB snapshots:dmaster
snapshot withenable_components
bearing a concrete value (as per sample data setup)dmaster-vdel
snapshot with no specific value ofenable_components
Then I ran the upgrade on each. Afterward, I checked both
civicrm_extension
andcivicrm_setting
by running these commands:In both DB snapshots, the upgrade produced a decent list of components. e.g. on the second snapshot (
dmaster-vdel
), the final output was: