Problem/Motivation
During migration of a customer's website, the following error occurred:
[error] The "i18n_taxonomy_term_reference_plain" plugin does not exist. Valid plugin IDs for Drupal\Core\Field\FormatterPluginManager are: comment_permalink, ...
After doing a quick research, we found a comment mentioning "i18n_taxonomy_term_reference_link". Searching through Drupal core, I found the according migration mapping inside "web/core/modules/taxonomy/src/Plugin/migrate/field/TaxonomyTermReference.php", where it seems "i18n_taxonomy_term_reference_plain" just got overlooked!
Proposed resolution
Add a mapping inside "web/core/modules/taxonomy/src/Plugin/migrate/field/TaxonomyTermReference.php" for "i18n_taxonomy_term_reference_plain"
Remaining tasks
User interface changes
API changes
Data model changes
Release notes snippet
Issue fork drupal-3314134
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
- 3314134-error--the
changes, plain diff MR !2838
Comments
Comment #3
grevil commentedPlease review the patch I provided!
Just ran a migration with the patch applied, and the error is not present any more! :)
Comment #4
anybodyFunny that nobody ran into this (or created an issue for this) yet, but I can confirm the issue and the fix. Nice finding @Grevil!
I'm setting this RTBC as it's just the same as the other cases to let maintainers decide if this needs additional tests or something. The fix itself works totally fine.
Static Diff patch attached.
This is where the formatter is implemented in i18n:
https://git.drupalcode.org/project/i18n/-/blob/7.x-1.x/i18n_taxonomy/i18...
And this shows that
i18n_taxonomy_term_reference_plainwasn't mapped anywhere yet:https://git.drupalcode.org/search?search=i18n_taxonomy_term_reference_pl...
Comment #5
anybody@Grevil: I just saw here https://git.drupalcode.org/search?search=i18n_taxonomy_term_reference_li... that i18n_taxonomy_term_reference_link is listed in core/modules/migrate_drupal/tests/src/Kernel/d7/FieldDiscoveryTest.php
So we should add it there, too, I guess. So back to NW.
Comment #6
anybodyMade the change. Back to needs review. :)
Comment #8
anybodyThe MR is the right one, the tested patch shows the missing test.
Comment #9
quietone commentedUpdating the title to show what this is actually doing.
The last time a taxonomy field formatter type was added was #3119254: Add taxonomy_term_reference_plain and taxonomy_term_reference_rss_category to TaxonomyTermReference. For that issue the drupal7 fixture was also updated to include the formatter being added. I would like to forego that in this issue. This is just adding an item to a mapping and the code using that mapping is well tested.
Comment #10
alexpottCommitted and pushed 44454ec27a to 10.1.x and b2ab27aa23 to 10.0.x and 68b60d9c47 to 9.5.x. Thanks!
Comment #14
anybodyWhao, thank you all :) That was fast!
Comment #15
grevil commentedThanks for the fast commit! Here is a static patch for the changes, if anyone needs it! :)
Comment #16
alexpottJust realised as a non-disruptive bug fix this is eligible for 9.4.x and as a migration thing it is always useful to be backported to the current branch... so it'll be in the next 9.4.x release (unless it is a security one).