Quantcast
Channel: Issues for Drupal core
Viewing all articles
Browse latest Browse all 294539

Migrating into "hidden" widget

$
0
0

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.


Viewing all articles
Browse latest Browse all 294539

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>