comparison 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
comparison
equal deleted inserted replaced
17:129ea1e6d783 18:af1871eacc83
11 11
12 /** 12 /**
13 * {@inheritdoc} 13 * {@inheritdoc}
14 */ 14 */
15 public function getProcess() { 15 public function getProcess() {
16 if ($this->init) { 16 if (!$this->init) {
17 return parent::getProcess(); 17 $this->init = TRUE;
18 } 18 $this->fieldDiscovery->addEntityFieldProcesses($this, 'comment');
19 $this->init = TRUE;
20 if (!\Drupal::moduleHandler()->moduleExists('field')) {
21 return parent::getProcess();
22 }
23 $definition['source'] = [
24 'ignore_map' => TRUE,
25 ] + $this->getSourceConfiguration();
26 $definition['source']['plugin'] = 'd7_field_instance';
27 $definition['destination']['plugin'] = 'null';
28 $definition['idMap']['plugin'] = 'null';
29 $field_migration = $this->migrationPluginManager->createStubMigration($definition);
30 foreach ($field_migration->getSourcePlugin() as $row) {
31 $field_name = $row->getSourceProperty('field_name');
32 $field_type = $row->getSourceProperty('type');
33 if ($this->fieldPluginManager->hasDefinition($field_type)) {
34 if (!isset($this->fieldPluginCache[$field_type])) {
35 $this->fieldPluginCache[$field_type] = $this->fieldPluginManager->createInstance($field_type, [], $this);
36 }
37 $info = $row->getSource();
38 $this->fieldPluginCache[$field_type]->defineValueProcessPipeline($this, $field_name, $info);
39 }
40 else {
41 $this->setProcessOfProperty($field_name, $field_name);
42 }
43 } 19 }
44 return parent::getProcess(); 20 return parent::getProcess();
45 } 21 }
46 22
47 } 23 }