While migrating a site from drupal 7 to 8 I found these errors at the field formatter migration:

For the sake of SEO, here is the error in text format:

The "text_plain" plugin does not exist

Debugging this migration led me to this line, where there is a replacement for text_default but not for text_plain:

Comments

juampynr created an issue. See original summary.

juampynr’s picture

Status: Active » Needs review
Issue tags: +migrate
StatusFileSize
new737 bytes

Here is a patch that fixes it.

juampynr’s picture

Issue summary: View changes
heddn’s picture

Status: Needs review » Needs work
Issue tags: -migrate +Needs tests

NW because needs tests.

juampynr’s picture

Status: Needs work » Needs review
Issue tags: -Needs tests +migrate
StatusFileSize
new1.9 KB
new2.62 KB

Here is a test only patch and a full patch with the fix.

The last submitted patch, 5: drupal-map-text_plain-formatter-3042223-5-test-only.patch, failed testing. View results
- codesniffer_fixes.patch Interdiff of automated coding standards fixes only.

heddn’s picture

Status: Needs review » Reviewed & tested by the community
Issue tags: -migrate

Fully tested. Looking good.

catch’s picture

Version: 8.8.x-dev » 8.7.x-dev
Status: Reviewed & tested by the community » Fixed

fixed this on commit to 8.8.x and 8.7.x, thanks!


Checking changed files...
PHPCS: core/modules/text/src/Plugin/migrate/field/d7/TextField.php passed
g
FILE: ...es/text/tests/src/Unit/Plugin/migrate/field/d7/TextFieldTest.php
----------------------------------------------------------------------
FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
----------------------------------------------------------------------
52 | WARNING | [x] A comma should follow the last multiline array

  • catch committed 27115d0 on 8.8.x
    Issue #3042223 by juampynr, heddn: Map text_plain field formatter to...

  • catch committed 6b10a28 on 8.7.x
    Issue #3042223 by juampynr, heddn: Map text_plain field formatter to...
alexpott’s picture

This change introduced scalar typehints. Since this was backported I've removed them so PHP5 tests pass on PHP 5.5.

Committed and pushed e1f5186b43 to 8.8.x and 1f8ae1386b to 8.7.x. Thanks!

  • alexpott committed 834c814 on 8.8.x
    Issue #3042223 follow-up by alexpott: Map text_plain field formatter to...

  • alexpott committed 1f8ae13 on 8.7.x
    Issue #3042223 follow-up by alexpott: Map text_plain field formatter to...

Status: Fixed » Closed (fixed)

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

dariogcode’s picture

I'm still receiving this error in Drupal 8.7.7

The "text_plain" plugin does not exist. Valid plugin IDs for Drupal\Core\Field\FormatterPluginManager are: comment_username, comment_default, comment_permalink, computed_decimal, computed_integer, computed_number_unformatted, computed_string,   [error]
datetime_custom, datetime_default, datetime_plain, datetime_time_ago, entity_reference_revisions_entity_view, field_collection_editable, field_collection_items, field_collection_list, file_link, file_audio, file_extension, file_filemime,
file_size, file_uri, file_video, file_default, file_rss_enclosure, file_table, file_url_plain, file_download_link, file_image, file_image_responsive, image, image_url, link, link_separate, media_thumbnail, oembed, metatag_empty_formatter,
list_default, list_key, redirect_source, smart_trim, entity_reference_rss_category, telephone_link, term_reference_tree, text_default, text_summary_or_trimmed, text_trimmed, author, user_name, webform_entity_reference_entity_view,
webform_entity_reference_link, webform_entity_reference_url, paragraph_summary, basic_string, boolean, number_decimal, entity_reference_entity_view, entity_reference_entity_id, entity_reference_label, number_integer, language, email_mailto,
number_unformatted, string, timestamp_ago, timestamp, uri_link (/app/web/core/lib/Drupal/Component/Plugin/Discovery/DiscoveryTrait.php:53)
gbirch’s picture

Yes, I have the same problem with Drupal 8.7.8

This patch is great, as far as it goes, but you also need the same replacement for the "string_long" case (D7 long plain text fields). Also for telephone fields, but that's another issue.

i.e. at line 35 of TextField.php:

case 'string_long':
$formatter_type = str_replace(['text_default', 'text_plain'], 'basic_string', $formatter_type);
break;

Will roll a patch when I have a chance, but this may help someone in the meantime.