drupal-8.remove_handler_submit_setting-2715589.php 659 Bytes
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26
<?php

/**
 * @file
 * Provides necessary database additions for testing
 * field_post_update_remove_handler_submit_setting()
 */

use Drupal\Core\Database\Database;

$connection = Database::getConnection();

$config = unserialize($connection->select('config', 'c')
  ->fields('c', ['data'])
  ->condition('collection', '')
  ->condition('name', 'field.field.node.article.field_tags')
  ->execute()
  ->fetchField());

$config['settings']['handler_submit'] = 'Change handler';

$connection->update('config')
  ->fields(['data' => serialize($config)])
  ->condition('collection', '')
  ->condition('name', 'field.field.node.article.field_tags')
  ->execute();