class ForumVocabulary

Same name in this branch
  1. 10 core/modules/forum/src/Plugin/migrate/process/ForumVocabulary.php \Drupal\forum\Plugin\migrate\process\ForumVocabulary
Same name in other branches
  1. 9 core/modules/taxonomy/src/Plugin/migrate/process/ForumVocabulary.php \Drupal\taxonomy\Plugin\migrate\process\ForumVocabulary
  2. 8.9.x core/modules/taxonomy/src/Plugin/migrate/process/ForumVocabulary.php \Drupal\taxonomy\Plugin\migrate\process\ForumVocabulary
  3. 11.x core/modules/forum/src/Plugin/migrate/process/ForumVocabulary.php \Drupal\forum\Plugin\migrate\process\ForumVocabulary

Checks if the vocabulary being migrated is the one used for forums.

Drupal 8 Forum is expecting specific machine names for its field and vocabulary names. This process plugin forces a given machine name to the field or vocabulary that is being migrated.

The 'forum_vocabulary' source property is evaluated in the d6_taxonomy_vocabulary or d7_taxonomy_vocabulary source plugins and is set to true if the vocabulary vid being migrated is the same as the one in the 'forum_nav_vocabulary' variable on the source site.

Example:


process:
  field_name:
    plugin: forum_vocabulary
    machine_name: taxonomy_forums

Hierarchy

Expanded class hierarchy of ForumVocabulary

Deprecated

in drupal:10.1.0 and is removed from drupal:11.0.0. Use \Drupal\forum\Plugin\migrate\process\ForumVocabulary instead.

See also

https://www.drupal.org/node/3387830

File

core/modules/taxonomy/src/Plugin/migrate/process/ForumVocabulary.php, line 35

Namespace

Drupal\taxonomy\Plugin\migrate\process
View source
class ForumVocabulary extends ProcessPluginBase {
    
    /**
     * Constructs a MigrationLookup object.
     *
     * @param array $configuration
     *   A configuration array containing information about the plugin instance.
     * @param string $plugin_id
     *   The plugin_id for the plugin instance.
     * @param mixed $plugin_definition
     *   The plugin implementation definition.
     */
    public function __construct(array $configuration, $plugin_id, $plugin_definition) {
        @trigger_error(__CLASS__ . 'is deprecated in drupal:10.1.0 and is removed from drupal:11.0.0. Use \\Drupal\\forum\\Plugin\\migrate\\process\\ForumVocabulary instead. See https://www.drupal.org/node/3387830', E_USER_DEPRECATED);
        parent::__construct($configuration, $plugin_id, $plugin_definition);
    }
    
    /**
     * {@inheritdoc}
     */
    public function transform($value, MigrateExecutableInterface $migrate_executable, Row $row, $destination_property) {
        if ($row->getSourceProperty('forum_vocabulary') && !empty($this->configuration['machine_name'])) {
            $value = $this->configuration['machine_name'];
        }
        return $value;
    }

}

Members

Title Sort descending Modifiers Object type Summary Overriden Title Overrides
ForumVocabulary::transform public function Performs the associated process. Overrides ProcessPluginBase::transform
ForumVocabulary::__construct public function Constructs a MigrationLookup object.
PluginInspectionInterface::getPluginDefinition public function Gets the definition of the plugin implementation. 6
PluginInspectionInterface::getPluginId public function Gets the plugin_id of the plugin instance. 2
ProcessPluginBase::$stopPipeline protected property Determines if processing of the pipeline is stopped.
ProcessPluginBase::isPipelineStopped public function Determines if the pipeline should stop processing. Overrides MigrateProcessInterface::isPipelineStopped
ProcessPluginBase::multiple public function Indicates whether the returned value requires multiple handling. Overrides MigrateProcessInterface::multiple 3
ProcessPluginBase::reset public function Resets the internal data of a plugin. Overrides MigrateProcessInterface::reset
ProcessPluginBase::stopPipeline protected function Stops pipeline processing after this plugin finishes.

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.