Problem/Motivation

The Paragraphs's field_collection field migration plugin system currently does not map `field_collection_fields` formatter from D7 to D8/D9.

Proposed resolution

Resolution is to map `field_collection_fields` field formatter from Field collection module in D7 to Paragraphs module in D8/D9.

Remaining tasks

Patch
Review
Commit

Comments

n4r3n created an issue. See original summary.

n4r3n’s picture

This patch provides field_collection_fields formatter mapping.

huzooka’s picture

Status: Active » Reviewed & tested by the community

This is okay!

tkiehne’s picture

Can confirm that this issue leads to an error during migration, after which the converted paragraph is not attached to the entity's view; to help out others looking for this, the error thrown during migration is:

[error] The "field_collection_fields" plugin does not exist. Valid plugin IDs for Drupal\Core\Field\FormatterPluginManager are:...

I can also confirm that the solution proposed above works. I should point out that there is a third formatter in D7 field_collection — "field_collection_list" — so a full solution should probably include this, e.g.:

  public function getFieldFormatterMap() {
    return [
      'field_collection_view' => 'entity_reference_revisions_entity_view',
      'field_collection_list' => 'entity_reference_revisions_entity_view',
      'field_collection_fields' => 'entity_reference_revisions_entity_view',
    ] + parent::getFieldFormatterMap();
  }
berdir’s picture

Status: Reviewed & tested by the community » Needs work

Let's update it then.

tkiehne’s picture

Re-rolled with suggested changes

sclsweb’s picture

I'm using this patch via paragraphs_migration -- I generated a set of migrations with migrate_plus, then customized upgrade_d7_field_formatter_settings.yml with the "field_collection_list" modification described in #4-- but upgrade_d7_field_formatter_settings is still failing. Every one of the view modes that include a field collection generates this type of message:

node 	event_program 	default 	field_added_item 	1 	Missing required properties for an EntityDisplay entity.
node 	event_program 	teaser 	field_added_item 	1 	Missing required properties for an EntityDisplay entity.

Is this an issue with the patch, or am I doing something wrong? (And if I am doing something wrong, please point me in the right direction to fix it, because that error message is a mystery -- if I try to just continue onwards without fixing it, I get similar errors on upgrade_d7_field_instance_widget_settings, and it is all downhill from there. Really stuck.)