Security update for Core, with self-updated composer
[yaffs-website] / web / core / modules / taxonomy / src / Plugin / migrate / source / d6 / Vocabulary.php
index 714fa933104a3f51a8c361faab69aabe1f515cb4..767daf45e121574e7f615ab407262f10a30becd2 100644 (file)
@@ -11,7 +11,7 @@ use Drupal\Core\Field\FieldStorageDefinitionInterface;
  *
  * @MigrateSource(
  *   id = "d6_taxonomy_vocabulary",
- *   source_provider = "taxonomy"
+ *   source_module = "taxonomy"
  * )
  */
 class Vocabulary extends DrupalSqlBase {
@@ -69,6 +69,14 @@ class Vocabulary extends DrupalSqlBase {
       ->fetchCol();
     $row->setSourceProperty('node_types', $node_types);
     $row->setSourceProperty('cardinality', ($row->getSourceProperty('tags') == 1 || $row->getSourceProperty('multiple') == 1) ? FieldStorageDefinitionInterface::CARDINALITY_UNLIMITED : 1);
+
+    // If the vocabulary being migrated is the one defined in the
+    // 'forum_nav_vocabulary' variable, set the 'forum_vocabulary' source
+    // property to true so we know this is the vocabulary used by Forum.
+    if ($this->variableGet('forum_nav_vocabulary', 0) == $row->getSourceProperty('vid')) {
+      $row->setSourceProperty('forum_vocabulary', TRUE);
+    }
+
     return parent::prepareRow($row);
   }