Skip to content
Snippets Groups Projects
Commit 4af9bb6b authored by Michael Lee's avatar Michael Lee
Browse files

Upgrading drupal/config_filter (1.8.0 => 1.9.0)

parent 62f37ad7
No related branches found
No related tags found
No related merge requests found
......@@ -4,7 +4,7 @@
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
"This file is @generated automatically"
],
"content-hash": "ddbb6bfcc5492e80908375b84ecb45bb",
"content-hash": "accbf7ddece37756fc0fca6526e9861c",
"packages": [
{
"name": "alchemy/zippy",
......@@ -2446,17 +2446,17 @@
},
{
"name": "drupal/config_filter",
"version": "1.8.0",
"version": "1.9.0",
"source": {
"type": "git",
"url": "https://git.drupalcode.org/project/config_filter.git",
"reference": "8.x-1.8"
"reference": "8.x-1.9"
},
"dist": {
"type": "zip",
"url": "https://ftp.drupal.org/files/projects/config_filter-8.x-1.8.zip",
"reference": "8.x-1.8",
"shasum": "5def5f97e79d6f5af6bb7007f012443475c90bfe"
"url": "https://ftp.drupal.org/files/projects/config_filter-8.x-1.9.zip",
"reference": "8.x-1.9",
"shasum": "cf6919fc5039771f8e6c2ed203f29ab0eca8d91f"
},
"require": {
"drupal/core": "^8 || ^9"
......@@ -2467,8 +2467,8 @@
"type": "drupal-module",
"extra": {
"drupal": {
"version": "8.x-1.8",
"datestamp": "1603870062",
"version": "8.x-1.9",
"datestamp": "1649336052",
"security-coverage": {
"status": "covered",
"message": "Covered by Drupal's security advisory policy"
......
......@@ -2522,18 +2522,18 @@
},
{
"name": "drupal/config_filter",
"version": "1.8.0",
"version_normalized": "1.8.0.0",
"version": "1.9.0",
"version_normalized": "1.9.0.0",
"source": {
"type": "git",
"url": "https://git.drupalcode.org/project/config_filter.git",
"reference": "8.x-1.8"
"reference": "8.x-1.9"
},
"dist": {
"type": "zip",
"url": "https://ftp.drupal.org/files/projects/config_filter-8.x-1.8.zip",
"reference": "8.x-1.8",
"shasum": "5def5f97e79d6f5af6bb7007f012443475c90bfe"
"url": "https://ftp.drupal.org/files/projects/config_filter-8.x-1.9.zip",
"reference": "8.x-1.9",
"shasum": "cf6919fc5039771f8e6c2ed203f29ab0eca8d91f"
},
"require": {
"drupal/core": "^8 || ^9"
......@@ -2544,8 +2544,8 @@
"type": "drupal-module",
"extra": {
"drupal": {
"version": "8.x-1.8",
"datestamp": "1603870062",
"version": "8.x-1.9",
"datestamp": "1649336052",
"security-coverage": {
"status": "covered",
"message": "Covered by Drupal's security advisory policy"
......
......@@ -5,7 +5,7 @@
'type' => 'project',
'install_path' => __DIR__ . '/../../',
'aliases' => array(),
'reference' => 'e84dd64613669ee59f663ea0db62b53e321ee2c8',
'reference' => '62f37ad72d72a4a2361f19ce3d56789dd9095950',
'name' => 'osu-asc-webservices/d8-upstream',
'dev' => true,
),
......@@ -503,12 +503,12 @@
'dev_requirement' => false,
),
'drupal/config_filter' => array(
'pretty_version' => '1.8.0',
'version' => '1.8.0.0',
'pretty_version' => '1.9.0',
'version' => '1.9.0.0',
'type' => 'drupal-module',
'install_path' => __DIR__ . '/../../web/modules/config_filter',
'aliases' => array(),
'reference' => '8.x-1.8',
'reference' => '8.x-1.9',
'dev_requirement' => false,
),
'drupal/config_ignore' => array(
......@@ -2101,7 +2101,7 @@
'type' => 'project',
'install_path' => __DIR__ . '/../../',
'aliases' => array(),
'reference' => 'e84dd64613669ee59f663ea0db62b53e321ee2c8',
'reference' => '62f37ad72d72a4a2361f19ce3d56789dd9095950',
'dev_requirement' => false,
),
'pantheon-systems/quicksilver-pushback' => array(
......
......@@ -5,7 +5,7 @@ core: 8.x
core_version_requirement: ^8 || ^9
package: Config
# Information added by Drupal.org packaging script on 2020-10-28
version: '8.x-1.8'
# Information added by Drupal.org packaging script on 2022-04-07
version: '8.x-1.9'
project: 'config_filter'
datestamp: 1603870063
datestamp: 1649336058
......@@ -6,7 +6,7 @@ package: Testing
dependencies:
- config_filter:config_filter
# Information added by Drupal.org packaging script on 2020-10-28
version: '8.x-1.8'
# Information added by Drupal.org packaging script on 2022-04-07
version: '8.x-1.9'
project: 'config_filter'
datestamp: 1603870063
datestamp: 1649336058
......@@ -6,7 +6,7 @@ package: Testing
dependencies:
- config_filter:config_filter
# Information added by Drupal.org packaging script on 2020-10-28
version: '8.x-1.8'
# Information added by Drupal.org packaging script on 2022-04-07
version: '8.x-1.9'
project: 'config_filter'
datestamp: 1603870063
datestamp: 1649336058
......@@ -13,6 +13,8 @@
*/
class ConfigFilterStorageFactoryTest extends KernelTestBase {
use ConfigStorageTestTrait;
/**
* {@inheritdoc}
*/
......@@ -38,7 +40,7 @@ public function testServiceProvider() {
// Config Filter makes the sync storage a filtered storage.
$this->assertInstanceOf(FilteredStorageInterface::class, $this->container->get('config.storage.sync'));
// Export the configuration. The pirate filter changes system.site.
$this->copyConfig($this->container->get('config.storage'), $this->container->get('config.storage.sync'));
$this->copyConfig($this->getExportStorage(), $this->getSyncFileStorage());
// The pirate filter changes the system.site when importing.
$this->assertEquals(['system.site'], $this->configImporter()->getStorageComparer()->getChangelist('update'));
......
......@@ -113,7 +113,7 @@ protected function getExportStorage(): StorageInterface {
// Create a filtered storage.
$filtered = $this->container->get('config_filter.storage_factory')->getFilteredStorage($memory, ['config.storage.sync']);
// Then write the core export storage to this new storage.
$this->copyConfig($unfiltered, $filtered);
self::replaceAllStorageContents($unfiltered, $filtered);
return $memory;
}
......@@ -155,4 +155,42 @@ protected static function assertStorageEquals(StorageInterface $expected, Storag
}
}
/**
* Copy the configuration from one storage to another and remove stale items.
*
* This method is the copy of how it worked prior to Drupal 9.4.
* See https://www.drupal.org/node/3273823 for more details.
*
* @param \Drupal\Core\Config\StorageInterface $source
* The configuration storage to copy from.
* @param \Drupal\Core\Config\StorageInterface $target
* The configuration storage to copy to.
*/
private static function replaceAllStorageContents(StorageInterface $source, StorageInterface &$target) {
// Make sure there is no stale configuration in the target storage.
foreach (array_merge([StorageInterface::DEFAULT_COLLECTION], $target->getAllCollectionNames()) as $collection) {
$target->createCollection($collection)->deleteAll();
}
// Copy all the configuration from all the collections.
foreach (array_merge([StorageInterface::DEFAULT_COLLECTION], $source->getAllCollectionNames()) as $collection) {
$source_collection = $source->createCollection($collection);
$target_collection = $target->createCollection($collection);
foreach ($source_collection->listAll() as $name) {
$data = $source_collection->read($name);
if ($data !== FALSE) {
$target_collection->write($name, $data);
}
else {
\Drupal::logger('config')->notice('Missing required data for configuration: %config', [
'%config' => $name,
]);
}
}
}
// Make sure that the target is set to the same collection as the source.
$target = $target->createCollection($source->getCollectionName());
}
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment