remove-description-from-tags-vocabulary.php

Same filename and directory in other branches
  1. 10 core/modules/taxonomy/tests/fixtures/update/remove-description-from-tags-vocabulary.php

Empties the description of the `tags` vocabulary.

File

core/modules/taxonomy/tests/fixtures/update/remove-description-from-tags-vocabulary.php

View source
<?php


/**
 * @file
 * Empties the description of the `tags` vocabulary.
 */
use Drupal\Core\Database\Database;
$connection = Database::getConnection();
$data = $connection->select('config')
    ->condition('name', 'taxonomy.vocabulary.tags')
    ->fields('config', [
    'data',
])
    ->execute()
    ->fetchField();
$data = unserialize($data);
$data['description'] = "\n";
$connection->update('config')
    ->condition('name', 'taxonomy.vocabulary.tags')
    ->fields([
    'data' => serialize($data),
])
    ->execute();

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