public function MigrationPluginsAlterer::paragraphsMigrationBundleAdjust in Paragraphs 8
Remove 'field_' prefix from field collection bundles.
Parameters
array $migration: The migration configuration to process.
1 call to MigrationPluginsAlterer::paragraphsMigrationBundleAdjust()
- MigrationPluginsAlterer::alterMigrationPlugins in src/
MigrationPluginsAlterer.php - Adds field collection and paragraph migration dependencies where needed.
File
- src/
MigrationPluginsAlterer.php, line 87
Class
- MigrationPluginsAlterer
- Class MigrationPluginsAlterer.
Namespace
Drupal\paragraphsCode
public function paragraphsMigrationBundleAdjust(array &$migration) {
// @see https://www.drupal.org/project/drupal/releases/9.1.4
// @see https://www.drupal.org/project/drupal/issues/2565931
$key = version_compare(\Drupal::VERSION, '9.1.4', '<') ? 'bundle' : 'bundle_mapped';
if (!$this
->paragraphsMigrationPrepareProcess($migration['process'], $key)) {
return;
}
$bundle_process =& $migration['process'][$key];
$bundle_process[] = [
'plugin' => 'paragraphs_process_on_value',
'source_value' => 'entity_type',
'expected_value' => 'field_collection_item',
'process' => [
'plugin' => 'substr',
'start' => FieldCollection::FIELD_COLLECTION_PREFIX_LENGTH,
],
];
}