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

CommentFileSizeAuthor
#15 patch-15.patch1.76 KBgrevil
#4 2838.diff847 bytesanybody

Issue fork drupal-3314134

Command icon 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:

Comments

Grevil created an issue. See original summary.

grevil’s picture

Status: Active » Needs review

Please review the patch I provided!

Just ran a migration with the patch applied, and the error is not present any more! :)

anybody’s picture

Status: Needs review » Reviewed & tested by the community
StatusFileSize
new847 bytes

Funny 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_plain wasn't mapped anywhere yet:
https://git.drupalcode.org/search?search=i18n_taxonomy_term_reference_pl...

anybody’s picture

Status: Reviewed & tested by the community » Needs work

@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.

anybody’s picture

Status: Needs work » Needs review

Made the change. Back to needs review. :)

Status: Needs review » Needs work

The last submitted patch, 4: 2838.diff, failed testing. View results

anybody’s picture

Status: Needs work » Reviewed & tested by the community

The MR is the right one, the tested patch shows the missing test.

quietone’s picture

Title: [error] The "i18n_taxonomy_term_reference_plain" plugin does not exist » Add i18n_taxonomy_term_reference_plain to TaxonomyTermReference

Updating 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.

alexpott’s picture

Version: 10.1.x-dev » 9.5.x-dev
Status: Reviewed & tested by the community » Fixed

Committed and pushed 44454ec27a to 10.1.x and b2ab27aa23 to 10.0.x and 68b60d9c47 to 9.5.x. Thanks!

  • alexpott committed 44454ec on 10.1.x
    Issue #3314134 by Anybody, Grevil, quietone: Add...

  • alexpott committed b2ab27a on 10.0.x
    Issue #3314134 by Anybody, Grevil, quietone: Add...

  • alexpott committed 68b60d9 on 9.5.x
    Issue #3314134 by Anybody, Grevil, quietone: Add...
anybody’s picture

Whao, thank you all :) That was fast!

grevil’s picture

StatusFileSize
new1.76 KB

Thanks for the fast commit! Here is a static patch for the changes, if anyone needs it! :)

alexpott’s picture

Version: 9.5.x-dev » 9.4.x-dev

Just 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).

  • alexpott committed b7a9d21 on 9.4.x
    Issue #3314134 by Anybody, Grevil, quietone: Add...

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.