Issue #1943468 by andypost: Move Tags vocabulary to standard profile config.

8.0.x
webchick 2013-03-26 23:16:14 -07:00
parent e35d1f189f
commit 357ac577df
4 changed files with 13 additions and 19 deletions

View File

@ -40,7 +40,6 @@ abstract class TaxonomyTestBase extends WebTestBase {
'description' => $this->randomName(),
'vid' => drupal_strtolower($this->randomName()),
'langcode' => LANGUAGE_NOT_SPECIFIED,
'help' => '',
'weight' => mt_rand(0, 10),
));
$vocabulary->save();

View File

@ -60,7 +60,6 @@ class TermTranslationUITest extends EntityTranslationUITest {
'description' => $this->randomName(),
'vid' => $this->bundle,
'langcode' => LANGUAGE_NOT_SPECIFIED,
'help' => '',
'weight' => mt_rand(0, 10),
));
$this->vocabulary->save();
@ -110,7 +109,6 @@ class TermTranslationUITest extends EntityTranslationUITest {
'description' => $this->randomName(),
'vid' => 'untranslatable_voc',
'langcode' => LANGUAGE_NOT_SPECIFIED,
'help' => '',
'weight' => mt_rand(0, 10),
));
$untranslatable_vocabulary->save();

View File

@ -0,0 +1,7 @@
vid: tags
name: Tags
description: 'Use tags to group articles on similar topics into categories.'
hierarchy: '0'
weight: '0'
status: '1'
langcode: en

View File

@ -93,27 +93,16 @@ function standard_install() {
$user_settings = config('user.settings');
$user_settings->set('register', USER_REGISTER_VISITORS_ADMINISTRATIVE_APPROVAL)->save();
// Create a default vocabulary named "Tags", enabled for the 'article' content type.
$description = st('Use tags to group articles on similar topics into categories.');
$help = st('Enter a comma-separated list of words to describe your content.');
$vocabulary = entity_create('taxonomy_vocabulary', array(
'name' => st('Tags'),
'description' => $description,
'vid' => 'tags',
'langcode' => language_default()->langcode,
'help' => $help,
));
taxonomy_vocabulary_save($vocabulary);
// Create a default field named "Tags" for the 'article' content type.
$field = array(
'field_name' => 'field_' . $vocabulary->id(),
'field_name' => 'field_tags',
'type' => 'taxonomy_term_reference',
// Set cardinality to unlimited for tagging.
'cardinality' => FIELD_CARDINALITY_UNLIMITED,
'settings' => array(
'allowed_values' => array(
array(
'vocabulary' => $vocabulary->id(),
'vocabulary' => 'tags',
'parent' => 0,
),
),
@ -121,12 +110,13 @@ function standard_install() {
);
field_create_field($field);
$help = st('Enter a comma-separated list of words to describe your content.');
$instance = array(
'field_name' => 'field_' . $vocabulary->id(),
'field_name' => 'field_tags',
'entity_type' => 'node',
'label' => 'Tags',
'bundle' => 'article',
'description' => $vocabulary->help,
'description' => $help,
'widget' => array(
'type' => 'taxonomy_autocomplete',
'weight' => -4,