Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Problem/Motivation
Drupal 7 color settings migration assumes that theme machine names do not contain underscores – and the migration plugin definition skips processing several rows (e.g. color_%_screenshot
variables) which should be excluded by the migration source plugin.
Proposed resolution
Refactor the d7_color
source plugin – and change the d7_color
migration definition accordingly.
Remaining tasks
User interface changes
API changes
Data model changes
Release notes snippet
Comment | File | Size | Author |
---|---|---|---|
#18 | interdiff_16-18.txt | 648 bytes | narendra.rajwar27 |
#18 | 3187334-18.patch | 6.89 KB | narendra.rajwar27 |
#7 | core-fix_d7_color_migration-3187334-7.patch | 6.52 KB | Wim Leers |
#7 | interdiff.txt | 1.29 KB | Wim Leers |
#6 | core-fix_d7_color_migration-3187334-6.patch | 5.36 KB | Wim Leers |
Comments
Comment #2
huzookaComment #3
huzookaComment #4
Wim LeersThis is a follow-up to #2500495: Upgrade path for Color 7.x, which is the commit/issue that introduced the
d7_color
migration. Not a single commit has touched it since!Test failures analysis
This seems like a new regression. Reproduced.
This is caused by a
SchemaIncompleteException
with the messageSchema errors for color.theme.bartik with the following errors: color.theme.bartik: missing schema
being thrown by\Drupal\Core\Config\Development\ConfigSchemaChecker
because all Kernel tests have$strictConfigSchema = TRUE
:And further debugging shows very clearly what the bug is:
element_name
is simply missing from the process pipeline, which causes@MigrateDestination=color
to attempt to executewhile the first parameter of the
::set()
call will beNULL
, which in turn will trigger the config schema error:Arguably
\Drupal\Core\Config\Config::set()
should fail hard on::set(NULL, …)
. That would have made this problem evident immediately. Created task + patch: #3187720: Config::set($key, …) requires $key to be a string, but does not typehint nor check this.This too.Caused by the previous problem.[…]
Failed asserting that actual size 0 matches expected size 6.
This too.Also caused by the first problem.Review
Dependent on the solution to the problems above.
Comment #5
huzookaWell, I've deleted too much from the migration plugin definition.
The
element_name
destination property and its processes should be restored.Comment #6
Wim LeersDone.
Comment #7
Wim LeersAnd now update
ColorTest
as needed.Comment #9
Wim LeersComment #10
quietone CreditAttribution: quietone as a volunteer commented@Wim Leers, thanks for improving the color migration.
This is putting back a change that was removed while working on the original issue that added the color migration, around this comment.. Generally, the practice we follow is to get all the data from the source and then use the process pipeline to filter. That way one only has to look at the migration yml to know what is going on. I know that this is not a hard and fast rule but I would prefer to reduce the scope of this to the improvement of handling theme names with underscores. And if we not skipping rows here then this can be a lot simpler, I think.
The test failure in #4 is not fun at all. One such error was fixed in #3189064: Migration sql source plugins can not be serialised because of reference to the database connection and I've started added other ones to #3192893: [META] Serialization issues in Migration tests.
Comment #14
quietone CreditAttribution: quietone at PreviousNext commentedColor is deprecated in 9.5 and removed in Drupal 10, moving to the contrib project.
Comment #15
quietone CreditAttribution: quietone at PreviousNext commentedWrong project, try again.
Comment #16
narendra.rajwar27Adding re-rolled patch.
Comment #18
narendra.rajwar27Patch updated by fixing failed test case.