
| Current Path : /var/www/html/rocksensor/web/core/modules/help/tests/fixtures/update/ |
Linux ift1.ift-informatik.de 5.4.0-216-generic #236-Ubuntu SMP Fri Apr 11 19:53:21 UTC 2025 x86_64 |
| Current File : /var/www/html/rocksensor/web/core/modules/help/tests/fixtures/update/help-topics-3087499.php |
<?php
/**
* @file
* Contains database additions for testing the upgrade path for help topics.
*
* @see https://www.drupal.org/node/3087499
*/
use Drupal\Core\Database\Database;
use Drupal\Core\Serialization\Yaml;
$connection = Database::getConnection();
// Enable experimental help_topics module.
$extensions = $connection->select('config')
->fields('config', ['data'])
->condition('collection', '')
->condition('name', 'core.extension')
->execute()
->fetchField();
$extensions = unserialize($extensions);
$extensions['module']['help_topics'] = 0;
$connection->update('config')
->fields([
'data' => serialize($extensions),
])
->condition('collection', '')
->condition('name', 'core.extension')
->execute();
// Structure of configured block and search page.
$search_page = Yaml::decode(file_get_contents(__DIR__ . '/search.page.help_search.yml'));
$connection->insert('config')
->fields([
'collection',
'name',
'data',
])
->values([
'collection' => '',
'name' => 'search.page.help_search',
'data' => serialize($search_page),
])
->execute();