remove-description-from-article-content-type.php

Same filename in other branches
  1. 10 core/modules/node/tests/fixtures/update/remove-description-from-article-content-type.php

Empties the description of the `article` content type.

File

core/modules/node/tests/fixtures/update/remove-description-from-article-content-type.php

View source
<?php


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

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