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
The link field Title (disabled/optional/required) instance setting is not migrating from D7 to D8.
Proposed resolution
The D7 setting values (disabled/optional/required) need to be mapped to the D8 values (0/1/2).
Remaining tasks
Map the Title settings in the plugin transform() function.
User interface changes
API changes
Data model changes
Comment | File | Size | Author |
---|---|---|---|
#27 | d7_link_field_instance_settings-2678612-27.patch | 7.36 KB | jofitz |
#27 | interdiff.txt | 681 bytes | jofitz |
Comments
Comment #2
jofitz CreditAttribution: jofitz commentedMap the D7 settings to the D8 settings.
Comment #3
jofitz CreditAttribution: jofitz commentedComment #4
quietone CreditAttribution: quietone as a volunteer commentedComment #5
benjy CreditAttribution: benjy at PreviousNext commentedThis should be done in \Drupal\link\Plugin\migrate\cckfield\LinkField but that would be blocked on #2631736: Cckfield Plugins must distinguish core versions
Happy with the current approach for now if we can add some tests?
Comment #7
benjy CreditAttribution: benjy at PreviousNext commentedThis needs looking at again now that #2631736: Cckfield Plugins must distinguish core versions is in.
Comment #8
jofitz CreditAttribution: jofitz at ComputerMinds commentedComment #11
jofitz CreditAttribution: jofitz at ComputerMinds commentedComment #14
jofitz CreditAttribution: jofitz at ComputerMinds commentedPostponing this issue until #2674090: Unable to migrate D7 link fields has been resolved.
Comment #15
jofitz CreditAttribution: jofitz at ComputerMinds commentedComment #16
jofitz CreditAttribution: jofitz at ComputerMinds commentedComment #18
jofitz CreditAttribution: jofitz at ComputerMinds commentedComment #20
phenaproximaI'd prefer if these assertions were part of the main test method -- otherwise it's going to actually do the entire setup and execute all migrations again for this method.
Let's also use assertSame() here, since it's more precise (if the migration set the title setting to TRUE, this assertion would still pass even though the actual data would be wrong). Additionally, I'd prefer if we could assert against an actual class constant, if there is one, rather than a numeric value.
Beyond these concerns, I think this looks good. RTBC one the changes are made and tests are passing.
Comment #21
jofitz CreditAttribution: jofitz at ComputerMinds commentedThanks for the review @phenaproxima. I have made all the changes you suggested:
assertSame()
used instead ofassertEquals()
.Comment #22
phenaproximaI assume Drupal CI will pass this, so RTBC from me.
Comment #23
alexpottWhy the [0] here?
It'd be great to have test coverage of all of the values.
Comment #24
jofitz CreditAttribution: jofitz at ComputerMinds commentedOn it...
Comment #25
jofitz CreditAttribution: jofitz at ComputerMinds commentedThe
[0]
was totally redundant so has been removed.I've also added testing for the other two values.
Comment #27
jofitz CreditAttribution: jofitz at ComputerMinds commentedThe less said about that, the better!
Comment #28
mikeryanLooks good!
Comment #29
alexpottCommitted and pushed 057d3dc to 8.3.x and 497d2aa to 8.2.x. Thanks!