According to the documentation, you can remove fields from the Source and Destination pages in the UI by creating a DNM (Do Not Migrate) group (or other appropriate name). However, you have to do it on a field-by-field basis, and in cases like the Metatag module, which adds a ton of fields, that creates ~50 fields I would have to add to DNM one by one. Is there a way to specify fields using a wildcard, such as

$this->addFieldMapping('metatag_*')->issueGroup('DNM');

or even just all subfields, since those are the bulk of all metagag fields listed in the UI:

$this->addFieldMapping('metatag_og:*)->issueGroup('DNM');

This would allow me to make my UI cleaner without making my code so bulky.

Thanks.

Comments

mikeryan’s picture

Version: 7.x-2.6-rc2 » 7.x-2.x-dev
Category: Support request » Feature request
KarlShea’s picture

I have a migration with lots of enabled Metatag modules and I was determined to not have a giant list in code. You can add this to a base migration and then call it somewhere in your migration's constructor:

  private function ignoreMetatagFields() {
    foreach (array_keys($this->getDestination()->fields($this)) as $field) {
      if (strpos($field, 'metatag', 0) === 0) {
        $this->addUnmigratedDestinations(array($field));
      }
    }
  }