I'm working on setting up migrations for field collection which in D7 have a custom widget type called "field_collection_hidden." No specific widget needed to be made for D8 for this because any field can be hidden from edit forms. I'm wondering if there is a supported way to define my MigrateCckField object that will map "field_collection_hidden" in D7 to "hidden" in D8 (no widget). I'm thinking the answer would be in the getFieldWidgetMap() function.

I have tried the following:

  public function getFieldWidgetMap() {
    return [
      'field_collection_embed' => 'field_collection_embed',
      'field_collection_hidden' => 'hidden',
    ];
  }
  public function getFieldWidgetMap() {
    return [
      'field_collection_embed' => 'field_collection_embed',
      'field_collection_hidden' => 'asdfasdfafa',
    ];
  }

These do produce the desired result but with an error The "hidden" plugin does not exist. (/home/jmuzz/devel/local.d8.com/core/lib/Drupal/Component/Plugin/Discovery/DiscoveryTrait.php:52)

  public function getFieldWidgetMap() {
    return [
      'field_collection_embed' => 'field_collection_embed',
      'field_collection_hidden' => NULL,
    ];
  }
  public function getFieldWidgetMap() {
    return [
      'field_collection_embed' => 'field_collection_embed',
      'field_collection_hidden' => '',
    ];
  }

These do not produce an error but set the field to use the field_collection_embed widget which is the default.

Comments

jmuzz created an issue. See original summary.

Version: 8.2.x-dev » 8.3.x-dev

Drupal 8.2.0-beta1 was released on August 3, 2016, which means new developments and disruptive changes should now be targeted against the 8.3.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.3.x-dev » 8.4.x-dev

Drupal 8.3.0-alpha1 will be released the week of January 30, 2017, which means new developments and disruptive changes should now be targeted against the 8.4.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.4.x-dev » 8.5.x-dev

Drupal 8.4.0-alpha1 will be released the week of July 31, 2017, which means new developments and disruptive changes should now be targeted against the 8.5.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.5.x-dev » 8.6.x-dev

Drupal 8.5.0-alpha1 will be released the week of January 17, 2018, which means new developments and disruptive changes should now be targeted against the 8.6.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.6.x-dev » 8.7.x-dev

Drupal 8.6.0-alpha1 will be released the week of July 16, 2018, which means new developments and disruptive changes should now be targeted against the 8.7.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.7.x-dev » 8.8.x-dev

Drupal 8.7.0-alpha1 will be released the week of March 11, 2019, which means new developments and disruptive changes should now be targeted against the 8.8.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

heddn’s picture

Status: Active » Closed (outdated)

Field collection to paragraphs migrations have changed a lot in the past few years. I think this could be marked resolved.