Mercurial > hg > isophonics-drupal-site
diff core/modules/comment/src/Plugin/migrate/D7Comment.php @ 18:af1871eacc83
Update to Drupal core 8.7.1
author | Chris Cannam |
---|---|
date | Thu, 09 May 2019 15:33:08 +0100 |
parents | 129ea1e6d783 |
children |
line wrap: on
line diff
--- a/core/modules/comment/src/Plugin/migrate/D7Comment.php Thu Feb 28 13:21:36 2019 +0000 +++ b/core/modules/comment/src/Plugin/migrate/D7Comment.php Thu May 09 15:33:08 2019 +0100 @@ -13,33 +13,9 @@ * {@inheritdoc} */ public function getProcess() { - if ($this->init) { - return parent::getProcess(); - } - $this->init = TRUE; - if (!\Drupal::moduleHandler()->moduleExists('field')) { - return parent::getProcess(); - } - $definition['source'] = [ - 'ignore_map' => TRUE, - ] + $this->getSourceConfiguration(); - $definition['source']['plugin'] = 'd7_field_instance'; - $definition['destination']['plugin'] = 'null'; - $definition['idMap']['plugin'] = 'null'; - $field_migration = $this->migrationPluginManager->createStubMigration($definition); - foreach ($field_migration->getSourcePlugin() as $row) { - $field_name = $row->getSourceProperty('field_name'); - $field_type = $row->getSourceProperty('type'); - if ($this->fieldPluginManager->hasDefinition($field_type)) { - if (!isset($this->fieldPluginCache[$field_type])) { - $this->fieldPluginCache[$field_type] = $this->fieldPluginManager->createInstance($field_type, [], $this); - } - $info = $row->getSource(); - $this->fieldPluginCache[$field_type]->defineValueProcessPipeline($this, $field_name, $info); - } - else { - $this->setProcessOfProperty($field_name, $field_name); - } + if (!$this->init) { + $this->init = TRUE; + $this->fieldDiscovery->addEntityFieldProcesses($this, 'comment'); } return parent::getProcess(); }