Commit 4ed7a7d6 authored by catch's avatar catch

Issue #1552396 by andypost, sun, tim.plunkett, amateescu, YesCT: Convert...

Issue #1552396 by andypost, sun, tim.plunkett, amateescu, YesCT: Convert vocabularies into configuration.
parent 81402727
......@@ -37,14 +37,14 @@ function setUp() {
$vocabulary = entity_create('taxonomy_vocabulary', array(
'name' => $this->randomName(),
'description' => $this->randomName(),
'machine_name' => drupal_strtolower($this->randomName()),
'vid' => drupal_strtolower($this->randomName()),
'langcode' => LANGUAGE_NOT_SPECIFIED,
'help' => '',
'nodes' => array('article' => 'article'),
'weight' => mt_rand(0, 10),
));
taxonomy_vocabulary_save($vocabulary);
$this->vocabulary = $vocabulary->machine_name;
$vocabulary->save();
$this->vocabulary = $vocabulary->id();
}
/**
......
......@@ -34,19 +34,19 @@ function setUp() {
// Create a vocabulary named "Tags".
$vocabulary = entity_create('taxonomy_vocabulary', array(
'name' => 'Tags',
'machine_name' => 'tags',
'vid' => 'tags',
'langcode' => LANGUAGE_NOT_SPECIFIED,
));
taxonomy_vocabulary_save($vocabulary);
$vocabulary->save();
$field = array(
'field_name' => 'field_' . $vocabulary->machine_name,
'field_name' => 'field_' . $vocabulary->id(),
'type' => 'taxonomy_term_reference',
);
field_create_field($field);
$instance = array(
'field_name' => 'field_' . $vocabulary->machine_name,
'field_name' => 'field_' . $vocabulary->id(),
'entity_type' => 'node',
'label' => 'Tags',
'bundle' => 'article',
......@@ -114,8 +114,8 @@ function createField() {
// Assert the field appears in the "re-use existing field" section for
// different entity types; e.g. if a field was added in a node entity, it
// should also appear in the 'taxonomy term' entity.
$vocabulary = taxonomy_vocabulary_load(1);
$this->drupalGet('admin/structure/taxonomy/' . $vocabulary->machine_name . '/fields');
$vocabulary = taxonomy_vocabulary_load('tags');
$this->drupalGet('admin/structure/taxonomy/' . $vocabulary->id() . '/fields');
$this->assertTrue($this->xpath('//select[@name="fields[_add_existing_field][field_name]"]//option[@value="' . $this->field_name . '"]'), 'Existing field was found in account settings.');
}
......
......@@ -37,12 +37,12 @@ function forum_enable() {
if (!$vocabulary) {
// If the module was installed and uninstalled previously, the vocabulary
// with machine name 'forums' might still exist.
$vocabulary = taxonomy_vocabulary_machine_name_load('forums');
$vocabulary = taxonomy_vocabulary_load('forums');
if (!$vocabulary) {
// Otherwise, installing from scratch; create the vocabulary.
$vocabulary = entity_create('taxonomy_vocabulary', array(
'name' => t('Forums'),
'machine_name' => 'forums',
'vid' => 'forums',
'langcode' => language_default()->langcode,
'description' => t('Forum navigation vocabulary'),
'hierarchy' => 1,
......@@ -51,7 +51,7 @@ function forum_enable() {
));
taxonomy_vocabulary_save($vocabulary);
}
$config->set('vocabulary', $vocabulary->vid)->save();
$config->set('vocabulary', $vocabulary->id())->save();
}
// Create the 'taxonomy_forums' field if it doesn't already exist.
......@@ -62,7 +62,7 @@ function forum_enable() {
'settings' => array(
'allowed_values' => array(
array(
'vocabulary' => $vocabulary->machine_name,
'vocabulary' => $vocabulary->id(),
'parent' => 0,
),
),
......@@ -76,7 +76,7 @@ function forum_enable() {
'langcode' => language_default()->langcode,
'description' => '',
'parent' => array(0),
'vid' => $vocabulary->vid,
'vid' => $vocabulary->id(),
));
taxonomy_term_save($term);
......
......@@ -220,17 +220,8 @@ function forum_menu_local_tasks_alter(&$data, $router_item, $root_path) {
function forum_entity_info_alter(&$info) {
// Take over URI construction for taxonomy terms that are forums.
if ($vid = config('forum.settings')->get('vocabulary')) {
// Within hook_entity_info_alter(), we can't invoke entity_load() as that
// would cause infinite recursion, so we call taxonomy_vocabulary_get_names()
// instead of taxonomy_vocabulary_load(). All we need is the machine name
// of $vid, so retrieving and iterating all the vocabulary names is somewhat
// inefficient, but entity info is cached across page requests, and an
// iteration of all vocabularies once per cache clearing isn't a big deal,
// and is done as part of taxonomy_entity_info() anyway.
foreach (taxonomy_vocabulary_get_names() as $machine_name => $vocabulary) {
if ($vid == $vocabulary->vid) {
$info['taxonomy_term']['bundles'][$machine_name]['uri_callback'] = 'forum_uri';
}
if (isset($info['taxonomy_term']['bundles'][$vid])) {
$info['taxonomy_term']['bundles'][$vid]['uri_callback'] = 'forum_uri';
}
}
}
......@@ -309,7 +300,7 @@ function forum_node_validate(Node $node, $form) {
}
$used = db_query_range('SELECT 1 FROM {taxonomy_term_data} WHERE tid = :tid AND vid = :vid', 0, 1, array(
':tid' => $term->tid,
':vid' => $term->vid,
':vid' => $term->bundle(),
))->fetchField();
if ($used && in_array($term->tid, $containers)) {
form_set_error('taxonomy_forums', t('The item %forum is a forum container, not a forum. Select one of the forums below instead.', array('%forum' => $term->label())));
......@@ -596,7 +587,8 @@ function forum_field_storage_pre_update($entity_type, $entity, &$skip_fields) {
*/
function forum_form_taxonomy_vocabulary_form_alter(&$form, &$form_state, $form_id) {
$vid = config('forum.settings')->get('vocabulary');
if (isset($form['vid']['#value']) && $form['vid']['#value'] == $vid) {
$vocabulary = $form_state['controller']->getEntity($form_state);
if ($vid == $vocabulary->id()) {
$form['help_forum_vocab'] = array(
'#markup' => t('This is the designated forum vocabulary. Some of the normal vocabulary options have been removed.'),
'#weight' => -1,
......@@ -607,6 +599,8 @@ function forum_form_taxonomy_vocabulary_form_alter(&$form, &$form_state, $form_i
$form['hierarchy']['#value'] = TAXONOMY_HIERARCHY_SINGLE;
// Do not allow to delete forum's vocabulary.
$form['actions']['delete']['#access'] = FALSE;
// Do not allow to change a vid of forum's vocabulary.
$form['vid']['#disabled'] = TRUE;
}
}
......@@ -782,7 +776,7 @@ function forum_forum_load($tid = NULL) {
// Load and validate the parent term.
if ($tid) {
$forum_term = taxonomy_term_load($tid);
if (!$forum_term || ($forum_term->vid != $vid)) {
if (!$forum_term || ($forum_term->bundle() != $vid)) {
return $cache[$tid] = FALSE;
}
}
......
......@@ -300,7 +300,7 @@ private function doAdminTests($user) {
$vocabulary = entity_create('taxonomy_vocabulary', array(
'name' => 'Tags',
'description' => $description,
'machine_name' => 'tags',
'vid' => 'tags',
'langcode' => language_default()->langcode,
'help' => $help,
));
......@@ -332,11 +332,10 @@ function editForumTaxonomy() {
$edit = array(
'name' => $title,
'description' => $description,
'machine_name' => drupal_strtolower(drupal_substr($this->randomName(), 3, 9)),
);
// Edit the vocabulary.
$this->drupalPost('admin/structure/taxonomy/' . $original_settings->machine_name . '/edit', $edit, t('Save'));
$this->drupalPost('admin/structure/taxonomy/' . $original_settings->id() . '/edit', $edit, t('Save'));
$this->assertResponse(200);
$this->assertRaw(t('Updated vocabulary %name.', array('%name' => $title)), 'Vocabulary was edited');
......
......@@ -88,7 +88,7 @@ public function testForumPager() {
'type' => 'forum',
'taxonomy_forums' => array(
LANGUAGE_NOT_SPECIFIED => array(
array('tid' => $tid, 'vid' => $vid, 'vocabulary_machine_name' => 'forums'),
array('tid' => $tid, 'vid' => $vid),
),
),
));
......
......@@ -33,7 +33,7 @@ function setUp() {
// Create a Tags vocabulary for the Article node type.
$vocabulary = entity_create('taxonomy_vocabulary', array(
'name' => t('Tags'),
'machine_name' => 'tags',
'vid' => 'tags',
));
$vocabulary->save();
......@@ -47,13 +47,14 @@ function setUp() {
*/
function testTermAlias() {
// Create a term in the default 'Tags' vocabulary with URL alias.
$vocabulary = taxonomy_vocabulary_load(1);
$vocabulary = taxonomy_vocabulary_load('tags');
$description = $this->randomName();;
$edit = array();
$edit['name'] = $this->randomName();
$edit['description[value]'] = $description;
$edit['path[alias]'] = $this->randomName();
$this->drupalPost('admin/structure/taxonomy/' . $vocabulary->machine_name . '/add', $edit, t('Save'));
$edit = array(
'name' => $this->randomName(),
'description[value]' => $description,
'path[alias]' => $this->randomName(),
);
$this->drupalPost('admin/structure/taxonomy/' . $vocabulary->id() . '/add', $edit, t('Save'));
// Confirm that the alias works.
$this->drupalGet($edit['path[alias]']);
......
......@@ -254,7 +254,7 @@ public function testNodeHooks() {
public function testTaxonomyTermHooks() {
$vocabulary = entity_create('taxonomy_vocabulary', array(
'name' => 'Test vocabulary',
'machine_name' => 'test',
'vid' => 'test',
'langcode' => LANGUAGE_NOT_SPECIFIED,
'description' => NULL,
'module' => 'entity_crud_hook_test',
......@@ -262,7 +262,7 @@ public function testTaxonomyTermHooks() {
taxonomy_vocabulary_save($vocabulary);
$term = entity_create('taxonomy_term', array(
'vid' => $vocabulary->vid,
'vid' => $vocabulary->id(),
'name' => 'Test term',
'langcode' => LANGUAGE_NOT_SPECIFIED,
'description' => NULL,
......@@ -314,7 +314,7 @@ public function testTaxonomyTermHooks() {
public function testTaxonomyVocabularyHooks() {
$vocabulary = entity_create('taxonomy_vocabulary', array(
'name' => 'Test vocabulary',
'machine_name' => 'test',
'vid' => 'test',
'langcode' => LANGUAGE_NOT_SPECIFIED,
'description' => NULL,
'module' => 'entity_crud_hook_test',
......@@ -330,7 +330,7 @@ public function testTaxonomyVocabularyHooks() {
));
$_SESSION['entity_crud_hook_test'] = array();
$vocabulary = taxonomy_vocabulary_load($vocabulary->vid);
$vocabulary = taxonomy_vocabulary_load($vocabulary->id());
$this->assertHookMessageOrder(array(
'entity_crud_hook_test_entity_load called for type taxonomy_vocabulary',
......@@ -349,7 +349,7 @@ public function testTaxonomyVocabularyHooks() {
));
$_SESSION['entity_crud_hook_test'] = array();
taxonomy_vocabulary_delete($vocabulary->vid);
taxonomy_vocabulary_delete($vocabulary->id());
$this->assertHookMessageOrder(array(
'entity_crud_hook_test_taxonomy_vocabulary_predelete called',
......
......@@ -74,7 +74,7 @@ protected function setUp() {
// We want a taxonomy term reference field. It needs a vocabulary, terms,
// a field and an instance. First, create the vocabulary.
$vocabulary = entity_create('taxonomy_vocabulary', array(
'machine_name' => strtolower($this->randomName()),
'vid' => drupal_strtolower($this->randomName()),
));
$vocabulary->save();
// Second, create the field.
......@@ -83,7 +83,7 @@ protected function setUp() {
'field_name' => $this->fieldName,
'type' => 'taxonomy_term_reference',
);
$field['settings']['allowed_values']['vocabulary'] = $vocabulary->machine_name;
$field['settings']['allowed_values']['vocabulary'] = $vocabulary->id();
field_create_field($field);
// Third, create the instance.
$instance = array(
......@@ -96,7 +96,7 @@ protected function setUp() {
for ($i = 0; $i <= 1; $i++) {
$term = entity_create('taxonomy_term', array(
'name' => $this->randomName(),
'vid' => $vocabulary->vid,
'vid' => $vocabulary->id(),
));
$term->save();
$this->terms[] = $term;
......
......@@ -89,7 +89,7 @@ public function testLanguageUpgrade() {
// A langcode property was added to vocabularies and terms. Check that
// existing vocabularies and terms got assigned the site default language.
$vocabulary = db_query('SELECT * FROM {taxonomy_vocabulary} WHERE vid = :vid', array(':vid' => 1))->fetchObject();
$vocabulary = taxonomy_vocabulary_load('tags');
$this->assertEqual($vocabulary->langcode, 'ca');
$term = db_query('SELECT * FROM {taxonomy_term_data} WHERE tid = :tid', array(':tid' => 1))->fetchObject();
$this->assertEqual($term->langcode, 'ca');
......
......@@ -2087,14 +2087,14 @@ function hook_mail($key, &$message, $params) {
);
if ($context['hook'] == 'taxonomy') {
$entity = $params['entity'];
$vocabulary = taxonomy_vocabulary_load($entity->vid);
$vocabulary = taxonomy_vocabulary_load($entity->id());
$variables += array(
'%term_name' => $entity->name,
'%term_description' => $entity->description,
'%term_id' => $entity->tid,
'%vocabulary_name' => $vocabulary->name,
'%vocabulary_description' => $vocabulary->description,
'%vocabulary_id' => $vocabulary->vid,
'%vocabulary_id' => $vocabulary->id(),
);
}
......
......@@ -30,12 +30,12 @@
* fieldable = TRUE,
* entity_keys = {
* "id" = "tid",
* "bundle" = "vocabulary_machine_name",
* "bundle" = "vid",
* "label" = "name",
* "uuid" = "uuid"
* },
* bundle_keys = {
* "bundle" = "machine_name"
* "bundle" = "vid"
* },
* view_modes = {
* "full" = {
......@@ -114,16 +114,6 @@ class Term extends Entity implements ContentEntityInterface {
*/
public $parent;
/**
* The machine name of the vocabulary the term is assigned to.
*
* If not given, this value will be set automatically by loading the
* vocabulary based on the $entity->vid property.
*
* @var string
*/
public $vocabulary_machine_name;
/**
* Implements Drupal\Core\Entity\EntityInterface::id().
*/
......@@ -135,6 +125,6 @@ public function id() {
* Implements Drupal\Core\Entity\EntityInterface::bundle().
*/
public function bundle() {
return $this->vocabulary_machine_name;
return $this->vid;
}
}
......@@ -7,7 +7,7 @@
namespace Drupal\taxonomy\Plugin\Core\Entity;
use Drupal\Core\Entity\Entity;
use Drupal\Core\Config\Entity\ConfigEntityBase;
use Drupal\Core\Annotation\Plugin;
use Drupal\Core\Annotation\Translation;
......@@ -22,7 +22,7 @@
* form_controller_class = {
* "default" = "Drupal\taxonomy\VocabularyFormController"
* },
* base_table = "taxonomy_vocabulary",
* config_prefix = "taxonomy.vocabulary",
* entity_keys = {
* "id" = "vid",
* "label" = "name"
......@@ -35,12 +35,12 @@
* }
* )
*/
class Vocabulary extends Entity {
class Vocabulary extends ConfigEntityBase {
/**
* The taxonomy vocabulary ID.
*
* @var integer
* @var string
*/
public $vid;
......@@ -51,13 +51,6 @@ class Vocabulary extends Entity {
*/
public $name;
/**
* The vocabulary machine name.
*
* @var string
*/
public $machine_name;
/**
* Description of the vocabulary.
*
......
......@@ -78,8 +78,8 @@ public function massageFormValues(array $values, array $form, array &$form_state
// Collect candidate vocabularies.
foreach ($field['settings']['allowed_values'] as $tree) {
if ($vocabulary = taxonomy_vocabulary_machine_name_load($tree['vocabulary'])) {
$vocabularies[$vocabulary->vid] = $vocabulary;
if ($vocabulary = entity_load('taxonomy_vocabulary', $tree['vocabulary'])) {
$vocabularies[$vocabulary->id()] = $vocabulary;
}
}
......@@ -94,9 +94,8 @@ public function massageFormValues(array $values, array $form, array &$form_state
$vocabulary = reset($vocabularies);
$term = array(
'tid' => 'autocreate',
'vid' => $vocabulary->vid,
'vid' => $vocabulary->id(),
'name' => $value,
'vocabulary_machine_name' => $vocabulary->machine_name,
);
}
$terms[] = (array)$term;
......
<?php
/**
* @file
* Definition of Drupal\taxonomy\Plugin\views\argument\VocabularyMachineName.
*/
namespace Drupal\taxonomy\Plugin\views\argument;
use Drupal\views\Plugin\views\argument\String;
use Drupal\Core\Annotation\Plugin;
/**
* Argument handler to accept a vocabulary machine name.
*
* @ingroup views_argument_handlers
*
* @Plugin(
* id = "vocabulary_machine_name",
* module = "taxonomy"
* )
*/
class VocabularyMachineName extends String {
/**
* Override the behavior of title(). Get the name of the vocabulary..
*/
function title() {
$query = db_select('taxonomy_vocabulary', 'v');
$query->addField('v', 'name');
$query->condition('v.machine_name', $this->argument);
$title = $query->execute()->fetchField();
if (empty($title)) {
return t('No vocabulary');
}
return check_plain($title);
}
}
......@@ -26,15 +26,12 @@ class VocabularyVid extends Numeric {
* Override the behavior of title(). Get the name of the vocabulary.
*/
function title() {
$query = db_select('taxonomy_vocabulary', 'v');
$query->addField('v', 'name');
$query->condition('v.vid', $this->argument);
$title = $query->execute()->fetchField();
if (empty($title)) {
return t('No vocabulary');
$vocabulary = entity_load('taxonomy_vocabulary', $this->argument);
if ($vocabulary) {
return check_plain($vocabulary->label());
}
return check_plain($title);
return t('No vocabulary');
}
}
......@@ -25,16 +25,6 @@ class Tid extends ArgumentDefaultPluginBase {
public function init(ViewExecutable $view, &$argument, $options) {
parent::init($view, $argument, $options);
// Convert legacy vids option to machine name vocabularies.
if (!empty($this->options['vids'])) {
$vocabularies = taxonomy_vocabulary_get_names();
foreach ($this->options['vids'] as $vid) {
if (isset($vocabularies[$vid], $vocabularies[$vid]->machine_name)) {
$this->options['vocabularies'][$vocabularies[$vid]->machine_name] = $vocabularies[$vid]->machine_name;
}
}
}
}
protected function defineOptions() {
......@@ -44,7 +34,7 @@ protected function defineOptions() {
$options['node'] = array('default' => FALSE, 'bool' => TRUE);
$options['anyall'] = array('default' => ',');
$options['limit'] = array('default' => FALSE, 'bool' => TRUE);
$options['vocabularies'] = array('default' => array());
$options['vids'] = array('default' => array());
return $options;
}
......@@ -73,16 +63,16 @@ public function buildOptionsForm(&$form, &$form_state) {
);
$options = array();
$vocabularies = taxonomy_vocabulary_get_names();
$vocabularies = entity_load_multiple('taxonomy_vocabulary');
foreach ($vocabularies as $voc) {
$options[$voc->machine_name] = check_plain($voc->name);
$options[$voc->id()] = $voc->label();
}
$form['vocabularies'] = array(
$form['vids'] = array(
'#type' => 'checkboxes',
'#title' => t('Vocabularies'),
'#options' => $options,
'#default_value' => $this->options['vocabularies'],
'#default_value' => $this->options['vids'],
'#states' => array(
'visible' => array(
':input[name="options[argument_default][taxonomy_tid][limit]"]' => array('checked' => TRUE),
......@@ -109,7 +99,7 @@ public function buildOptionsForm(&$form, &$form_state) {
public function submitOptionsForm(&$form, &$form_state, &$options = array()) {
// Filter unselected items so we don't unnecessarily store giant arrays.
$options['vocabularies'] = array_filter($options['vocabularies']);
$options['vids'] = array_filter($options['vids']);
}
function get_argument() {
......@@ -146,7 +136,7 @@ function get_argument() {
$tids = array();
// filter by vocabulary
foreach ($taxonomy as $tid => $vocab) {
if (!empty($this->options['vocabularies'][$vocab])) {
if (!empty($this->options['vids'][$vocab])) {
$tids[] = $tid;
}
}
......
......@@ -25,21 +25,11 @@ class Term extends ArgumentValidatorPluginBase {
public function init(ViewExecutable $view, &$argument, $options) {
parent::init($view, $argument, $options);
// Convert legacy vids option to machine name vocabularies.
if (!empty($this->options['vids'])) {
$vocabularies = taxonomy_vocabulary_get_names();
foreach ($this->options['vids'] as $vid) {
if (isset($vocabularies[$vid], $vocabularies[$vid]->machine_name)) {
$this->options['vocabularies'][$vocabularies[$vid]->machine_name] = $vocabularies[$vid]->machine_name;
}
}
}
}
protected function defineOptions() {
$options = parent::defineOptions();
$options['vocabularies'] = array('default' => array());
$options['vids'] = array('default' => array());
$options['type'] = array('default' => 'tid');
$options['transform'] = array('default' => FALSE, 'bool' => TRUE);
......@@ -47,19 +37,19 @@ protected function defineOptions() {
}
public function buildOptionsForm(&$form, &$form_state) {
$vocabularies = taxonomy_vocabulary_get_names();
$vocabularies = entity_load_multiple('taxonomy_vocabulary');
$options = array();
foreach ($vocabularies as $voc) {
$options[$voc->machine_name] = check_plain($voc->name);
$options[$voc->id()] = $voc->label();
}
$form['vocabularies'] = array(
$form['vids'] = array(
'#type' => 'checkboxes',
'#prefix' => '<div id="edit-options-validate-argument-vocabulary-wrapper">',
'#suffix' => '</div>',
'#title' => t('Vocabularies'),
'#options' => $options,
'#default_value' => $this->options['vocabularies'],
'#default_value' => $this->options['vids'],
'#description' => t('If you wish to validate for specific vocabularies, check them; if none are checked, all terms will pass.'),
);
......@@ -85,11 +75,11 @@ public function buildOptionsForm(&$form, &$form_state) {
public function submitOptionsForm(&$form, &$form_state, &$options = array()) {
// Filter unselected items so we don't unnecessarily store giant arrays.
$options['vocabularies'] = array_filter($options['vocabularies']);
$options['vids'] = array_filter($options['vids']);
}
function validate_argument($argument) {
$vocabularies = array_filter($this->options['vocabularies']);
$vocabularies = array_filter($this->options['vids']);
$type = $this->options['type'];
$transform = $this->options['transform'];
......@@ -105,7 +95,7 @@ function validate_argument($argument) {
return FALSE;
}
$this->argument->validated_title = check_plain($term->name);
return empty($vocabularies) || !empty($vocabularies[$term->vocabulary_machine_name]);
return empty($vocabularies) || !empty($vocabularies[$term->bundle()]);
case 'tids':
// An empty argument is not a term so doesn't pass.
......@@ -141,7 +131,7 @@ function validate_argument($argument) {
if (count($test)) {
$result = entity_load_multiple('taxonomy_term', $test);
foreach ($result as $term) {
if ($vocabularies && empty($vocabularies[$term->vocabulary_machine_name])) {
if ($vocabularies && empty($vocabularies[$term->bundle()])) {
$validated_cache[$term->id()] = FALSE;
return FALSE;
}
......@@ -166,7 +156,7 @@ function validate_argument($argument) {
$term->name = str_replace(' ', '-', $term->name);
}
if ($term && (empty($vocabularies) || !empty($vocabularies[$term->vocabulary_machine_name]))) {
if ($term && (empty($vocabularies) || !empty($vocabularies[$term->bundle()]))) {
if ($type == 'convert') {
$this->argument->argument = $term->id();
}
......@@ -180,7 +170,6 @@ function validate_argument($argument) {
function process_summary_arguments(&$args) {
$type = $this->options['type'];
$transform = $this->options['transform'];
$vocabularies = array_filter($this->options['vocabularies']);
if ($type == 'convert') {
$arg_keys = array_flip($args);
......
......@@ -31,10 +31,6 @@ public function init(ViewExecutable $view, &$options) {
$this->additional_fields['tid'] = 'tid';
$this->additional_fields['vid'] = 'vid';
$this->additional_fields['vocabulary_machine_name'] = array(
'table' => 'taxonomy_vocabulary',
'field' => 'machine_name',
);
}
protected function defineOptions() {
......@@ -67,7 +63,6 @@ function render($values) {
// access checks. See http://drupal.org/node/995156
$term = entity_create('taxonomy_term', array(
'vid' => $values->{$this->aliases['vid']},
'vocabulary_machine_name' => $values->{$this->aliases['vocabulary_machine_name']},
));
if (taxonomy_term_access('edit', $term)) {
$text = !empty($this->options['text']) ? $this->options['text'] : t('edit');
......
......@@ -37,10 +37,6 @@ public function init(ViewExecutable $view, &$options) {
$this->additional_fields['vid'] = 'vid';
$this->additional_fields['tid'] = 'tid';
$this->additional_fields['vocabulary_machine_name'] = array(
'table' => 'taxonomy_vocabulary',
'field' => 'machine_name',