3 namespace Drupal\taxonomy\Plugin\migrate\process;
5 use Drupal\migrate\MigrateExecutableInterface;
6 use Drupal\migrate\ProcessPluginBase;
7 use Drupal\migrate\Row;
10 * Checks if the vocabulary being migrated is the one used for forums.
12 * Drupal 8 Forum is expecting specific machine names for its field and
13 * vocabulary names. This process plugin forces a given machine name to the
14 * field or vocabulary that is being migrated.
16 * The 'forum_vocabulary' source property is evaluated in the
17 * d6_taxonomy_vocabulary or d7_taxonomy_vocabulary source plugins and is set to
18 * true if the vocabulary vid being migrated is the same as the one in the
19 * 'forum_nav_vocabulary' variable on the source site.
26 * plugin: forum_vocabulary
27 * machine_name: taxonomy_forums
30 * @MigrateProcessPlugin(
31 * id = "forum_vocabulary"
34 class ForumVocabulary extends ProcessPluginBase {
39 public function transform($value, MigrateExecutableInterface $migrate_executable, Row $row, $destination_property) {
40 if ($row->getSourceProperty('forum_vocabulary') && !empty($this->configuration['machine_name'])) {
41 $value = $this->configuration['machine_name'];