Still on Drupal 7? Security support for Drupal 7 ended on 5 January 2025. Please visit our Drupal 7 End of Life resources page to review all of your options.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
jofitzMap the D7 settings to the D8 settings.
Comment #3
jofitzComment #4
quietone commentedComment #5
benjy 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 commentedThis needs looking at again now that #2631736: Cckfield Plugins must distinguish core versions is in.
Comment #8
jofitzComment #11
jofitzComment #14
jofitzPostponing this issue until #2674090: Unable to migrate D7 link fields has been resolved.
Comment #15
jofitzComment #16
jofitzComment #18
jofitzComment #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
jofitzThanks 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
jofitzOn it...
Comment #25
jofitzThe
[0]was totally redundant so has been removed.I've also added testing for the other two values.
Comment #27
jofitzThe 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!