Feature Request

Ignore specific storage collections.

Use Case

Platform: Acquia Cloud Site Factory

We have to clone our english site ~35 times, one site per country. Each country site may have an arbitrary set of languages turned on. We need to be able to ignore what languages are turned on, because the languages running per-site are unknown.

Current State

After turning on Spanish, and running an export, the storage collection language.es gets created and outputs a bunch of files to [config-dir]/default/language/es.

It also creates the files language.entity.es.yml and language.negotiation.yml but these files are easily ignored. However, I CANNOT get language/es to be ignored.

Desired State

I have a field that lets me exclude storage collections, similar to the ignore settings field where you can list what config objects you want ignored.

In the "Collections Ignore" field, I would be able to list language.*. After doing so, when I export, nothing gets exported to [config-dir]/default/language. When importing, existing collection config in language.* would be ignored and not deleted/updated/created.

CommentFileSizeAuthor
#106 config-ignore-collections-fix.patch18.4 KBg.mustapha
#101 config-ignore-collections-2973431-rc-101.patch5.78 KBHitchShock
#95 config-ignore-collections-2973431-rc-95.patch2.09 KBHitchShock
#91 interdiff-88-91.txt554 byteshchonov
#91 2973431-91.patch18.5 KBhchonov
#88 config-ignore-collections-2973431-88.patch18.44 KBsdstyles
#79 interdiff-77-79.txt13.32 KBphma
#79 config-ignore-collections-2973431-79.patch18.4 KBphma
#78 interdiff-77-78.txt8.87 KBphma
#78 config-ignore-collections-2973431-78.patch17.22 KBphma
#77 config-ignore-collections-2973431-77.patch8.04 KBphma
#77 interdiff-76-77.txt616 bytesphma
#76 config-ignore-collections-2973431-76.patch7.74 KBphma
#32 config-ignore-collections-2973431-30-31.txt2.15 KBrajanvalecha12
#32 config-ignore-collections-2973431-31.patch10.68 KBrajanvalecha12
#30 config-ignore-collections-2973431-29-30.txt788 bytesrajanvalecha12
#30 config-ignore-collections-2973431-30.patch8.97 KBrajanvalecha12
#29 2973431-altering-storage-drush-commands-27-29.txt11.66 KBrajanvalecha12
#29 2973431-altering-storage-drush-commands-29.patch9.83 KBrajanvalecha12
#29 config-ignore-collections-2973431-26-29.txt11.93 KBrajanvalecha12
#29 config-ignore-collections-2973431-29.patch9.09 KBrajanvalecha12
#27 interdiff_supplementary-drush-commands_17-27.txt2.26 KBrajanvalecha12
#27 2973431-supplementary-drush-commands-27.patch7.38 KBrajanvalecha12
#26 config-ignore-collections-2973431-26.patch6.51 KBa.dmitriiev
#25 2973431-ignore-collections-25.patch3.62 KBjoey-santiago
#18 interdiff-ignore-collections-17-18.txt865 byteslpeabody
#18 2973431-ignore-collections-18.patch6.1 KBlpeabody
#17 2973431-supplementary-drush-commands-17.patch5.75 KBlpeabody
#17 2973431-ignore-collections-17.patch6.09 KBlpeabody
#8 2973431.8.patch3.47 KBGrayle
#34 config-ignore-collections-2973431-34.patch7.3 KBjefuri
#40 config-ignore-collections-2973431-40.patch8.68 KBjefuri
#42 config-ignore-collections-2973431-42.patch8.92 KBjefuri
#45 config-ignore-collections-2973431-45.patch8.91 KBmrinalini9
#45 interdiff-2973431-42-45.txt458 bytesmrinalini9
#52 config-ignore-collections-2973431-52.patch8.64 KBjefuri
#54 config-ignore-collections-2973431-54.patch9.15 KBnicothezulu
#54 config-ignore-collections-2973431-54.patch9.15 KBnicothezulu
#56 config-ignore-collections-2973431-56.patch9.39 KBnicothezulu
#57 config-ignore-collections-2973431-57.patch9.53 KBnicothezulu
#58 2973431-supplementary-drush-commands-58.patch6.25 KBethomas08
#59 config-ignore-collections-2973431-59.patch8.63 KBsokru
#59 interdiff-52-59.txt1020 bytessokru
#60 2973431-8.x-2.3-60.patch9.52 KBlpeabody
#61 config-ignore-collections-v2-3-2973431-61.patch9.22 KBalejomc
#61 config-ignore-collections-8.x-2.3-2973431-61.patch9.22 KBalejomc
Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

lpeabody created an issue. See original summary.

lpeabody’s picture

Issue summary: View changes
mariusdiacu’s picture

I would also like to have this feature. Here's my case:

I have a Drupal 8 multisite with a dev/stage/production environments. Client is operating translations on production (both user interface translations and config translations). Meanwhile, development team is working on some other features and from time to time, a deployment is done.

The problem is that before each deployment we have to export all config translations from production and put them into code. Otherwise it will get overridden when new features are deployed.

Ideally, there should be a possibility to completely ignore config translations from sync.

lpeabody’s picture

I did more research on this, and the current plugin mechanism of Config Filter cannot account for collections it seems. Deciding whether or not to import/export a collection falls under the purview of the StorageComparer class in Core. So, I wrote my own version of it and am using it in custom config-import/export Drush commands.


namespace Drupal\bax_base_config\Config;

use Drupal\Core\Config\StorageComparer as CoreStorageComparer;
use Drupal\Core\Config\StorageInterface;

/**
 * Overridden StorageComparer so we can control certain aspects of configuration
 * comparison. Unfortunately this is not a service so we cannot replace it
 * entirely.
 */
class StorageComparer extends CoreStorageComparer {

  /**
   * {@inheritdoc}
   */
  public function getAllCollectionNames($include_default = TRUE) {
    $collections = parent::getAllCollectionNames($include_default);
    $ignored_collections_settings = [
      'language.*',
    ];

    $collections = array_filter($collections, function ($collection) use ($ignored_collections_settings) {
      $collection_fill = array_fill(0, count($ignored_collections_settings), $collection);
      $filter_results = array_map('fnmatch', $ignored_collections_settings, $collection_fill);
      return !in_array(TRUE, $filter_results);
    });

    // If somehow the default collection got unset and we're told to include it,
    // this will include it.
    if ($include_default) {
      array_unshift($collections, StorageInterface::DEFAULT_COLLECTION);
    }

    return array_unique($collections);
  }


}

So, while Config Ignore really can't do anything about not exporting/importing to specific collections, given the namespace of the module I think it should still try to tackle it.

If Drupal Core replaced all instances of StorageComparer with a factory service, this would be a much easier problem to solve because you could just replace the service. Unfortunately, StorageComparer seems to be instantiated individually throughout the entire codebase.

I think it's important that this stuff makes it into CMI 2.0. In the meantime, if you duplicate the core config-import and config-export Drush commands, you can make-do with your own version of StorageComparer.

lpeabody’s picture

Title: Ignore configuration collections? » Ignore configuration storage collections?
validoll’s picture

Status: Active » Needs review

Hello!
I created simple module like Config ignore to ignore whole collections.
https://www.drupal.org/project/config_ignore_collection

Thanks @lpeabody to provide solution to ignore collection.

bircher’s picture

I looked at config_ignore_collection and the argumentation in #4. But I am afraid that the conclusion is not exactly right.

It is entirely possible to filter which languages are available. One simply has to implement \Drupal\config_filter\Config\StorageFilterInterface::filterGetAllCollectionNames. The StorageComparer should not be interacted with and it is not a service because it should always give an accurate diff. The filter allows to set this as you need. That said with CMI 2.0 this would become significantly easier. see #2991683: Move configuration transformation API in \Drupal\Core\Config namespace.

I am leaving this feature request open in case someone would like to create a patch for it. I would accept a new filter plugin that only filters out entire languages so that the ignore filter can be kept relatively simple. (And maybe a third one that combines ignoring some config in some language.)

Grayle’s picture

Assigned: Unassigned » Grayle
FileSize
3.47 KB

Damn, I should've come back to this ticket before quickly making a patch. But I'm on a deadline, and once I'm done I can refactor it to a new filter. And do it more efficiently using the filterGetAllCollectionNames instead of doing the check in matchConfig and activeRead.

lpeabody’s picture

I could have sworn I tried implementing \Drupal\config_filter\Config\StorageFilterInterface::filterGetAllCollectionNames. Though, it's hard to remember what I did 4+ months ago... I'm gonna have to revisit this, thanks for the suggestion.

@Grayle interesting approach!

RumyanaRuseva’s picture

For anyone who needs it: The patch from #8 works perfectly, even though still waiting for refactoring.

Grayle’s picture

Yeah sorry about that, not sure when I'll have time to refactor it. Been busier than I'd hoped as of late. If someone else wants to take a crack at it, be my guest.

lpeabody’s picture

Assigned: Grayle » Unassigned

Leaving unassigned for now since Grayle has offered up the chance for someone else to extend the work.

lpeabody’s picture

Status: Needs review » Needs work

Also marking Needs Work due to bircher's feedback on wanting this functionality separated out into separate filters.

lpeabody’s picture

Assigned: Unassigned » lpeabody

Did some testing of the patch in 8. Works well if there are no existing language collections in file storage. However, say I have language/es already exported in file storage (so there are lots of config/default/language/es/*.yml files), and I sync with a database that has no languages besides the default (English) enabled, and I do an import.

The result I've seen is that a database entry gets made for every configuration in the collection with data a:0:{}. During the import you'll eventually see this result:

Error: Call to a member function getThirdPartySetting() on null in /var/www/docroot/core/modules/content_translation/src/ContentTranslationManager.php on line 99 #0 /var/www/docroot/core/modules/content_translation/content_translation.module(180): Drupal\content_translation\ContentTranslationManager->isEnabled('shortcut', '')
#1 /var/www/docroot/core/lib/Drupal/Core/Extension/ModuleHandler.php(539): content_translation_entity_bundle_info_alter(Array, NULL, NULL)
#2 /var/www/docroot/core/lib/Drupal/Core/Entity/EntityTypeBundleInfo.php(110): Drupal\Core\Extension\ModuleHandler->alter('entity_bundle_i...', Array)
#3 /var/www/docroot/core/lib/Drupal/Core/Entity/EntityTypeBundleInfo.php(80): Drupal\Core\Entity\EntityTypeBundleInfo->getAllBundleInfo()
#4 /var/www/docroot/core/lib/Drupal/Core/Entity/Plugin/DataType/Deriver/EntityDeriver.php(101): Drupal\Core\Entity\EntityTypeBundleInfo->getBundleInfo('block')
#5 /var/www/docroot/core/lib/Drupal/Component/Plugin/Discovery/DerivativeDiscoveryDecorator.php(101): Drupal\Core\Entity\Plugin\DataType\Deriver\EntityDeriver->getDerivativeDefinitions(Array)
#6 /var/www/docroot/core/lib/Drupal/Component/Plugin/Discovery/DerivativeDiscoveryDecorator.php(87): Drupal\Component\Plugin\Discovery\DerivativeDiscoveryDecorator->getDerivatives(Array)
#7 /var/www/docroot/core/lib/Drupal/Core/Plugin/DefaultPluginManager.php(284): Drupal\Component\Plugin\Discovery\DerivativeDiscoveryDecorator->getDefinitions()
#8 /var/www/docroot/core/lib/Drupal/Core/Plugin/DefaultPluginManager.php(175): Drupal\Core\Plugin\DefaultPluginManager->findDefinitions()
#9 /var/www/docroot/core/lib/Drupal/Component/Plugin/Discovery/DiscoveryCachedTrait.php(22): Drupal\Core\Plugin\DefaultPluginManager->getDefinitions()
#10 /var/www/docroot/core/lib/Drupal/Core/TypedData/DataDefinition.php(195): Drupal\Core\Plugin\DefaultPluginManager->getDefinition('field_item:stri...')
#11 /var/www/docroot/core/lib/Drupal/Core/Field/BaseFieldDefinition.php(633): Drupal\Core\TypedData\DataDefinition->getClass()
#12 /var/www/docroot/core/lib/Drupal/Core/Field/BaseFieldDefinition.php(490): Drupal\Core\Field\BaseFieldDefinition->getMainPropertyName()
#13 /var/www/docroot/core/lib/Drupal/Core/Entity/RevisionLogEntityTrait.php(43): Drupal\Core\Field\BaseFieldDefinition->setDefaultValue('')
#14 /var/www/docroot/core/lib/Drupal/Core/Entity/EditorialContentEntityBase.php(23): Drupal\Core\Entity\EditorialContentEntityBase::revisionLogBaseFieldDefinitions(Object(Drupal\Core\Entity\ContentEntityType))
#15 /var/www/docroot/core/modules/block_content/src/Entity/BlockContent.php(180): Drupal\Core\Entity\EditorialContentEntityBase::baseFieldDefinitions(Object(Drupal\Core\Entity\ContentEntityType))
#16 /var/www/docroot/core/lib/Drupal/Core/Entity/EntityFieldManager.php(206): Drupal\block_content\Entity\BlockContent::baseFieldDefinitions(Object(Drupal\Core\Entity\ContentEntityType))
#17 /var/www/docroot/core/lib/Drupal/Core/Entity/EntityFieldManager.php(171): Drupal\Core\Entity\EntityFieldManager->buildBaseFieldDefinitions('block_content')
#18 /var/www/docroot/core/lib/Drupal/Core/Entity/EntityFieldManager.php(425): Drupal\Core\Entity\EntityFieldManager->getBaseFieldDefinitions('block_content')
#19 /var/www/docroot/core/lib/Drupal/Core/Entity/EntityManager.php(208): Drupal\Core\Entity\EntityFieldManager->getFieldStorageDefinitions('block_content')
#20 /var/www/docroot/core/lib/Drupal/Core/Entity/Sql/SqlContentEntityStorage.php(323): Drupal\Core\Entity\EntityManager->getFieldStorageDefinitions('block_content')
#21 /var/www/docroot/core/lib/Drupal/Core/Entity/Sql/SqlContentEntityStorage.php(188): Drupal\Core\Entity\Sql\SqlContentEntityStorage->getTableMapping()
#22 /var/www/docroot/core/lib/Drupal/Core/Entity/Sql/SqlContentEntityStorage.php(173): Drupal\Core\Entity\Sql\SqlContentEntityStorage->initTableLayout()
#23 /var/www/docroot/core/lib/Drupal/Core/Entity/Sql/SqlContentEntityStorage.php(138): Drupal\Core\Entity\Sql\SqlContentEntityStorage->__construct(Object(Drupal\Core\Entity\ContentEntityType), Object(Drupal\Core\Database\Driver\mysql\Connection), Object(Drupal\Core\Entity\EntityManager), Object(Drupal\Core\Cache\DatabaseBackend), Object(Drupal\language\ConfigurableLanguageManager), Object(Drupal\Core\Cache\MemoryCache\MemoryCache))
#24 /var/www/docroot/core/lib/Drupal/Core/Entity/EntityTypeManager.php(250): Drupal\Core\Entity\Sql\SqlContentEntityStorage::createInstance(Object(Drupal\Core\DependencyInjection\Container), Object(Drupal\Core\Entity\ContentEntityType))
#25 /var/www/docroot/core/lib/Drupal/Core/Entity/EntityTypeManager.php(239): Drupal\Core\Entity\EntityTypeManager->createHandlerInstance('Drupal\\Core\\Ent...', Object(Drupal\Core\Entity\ContentEntityType))
#26 /var/www/docroot/core/lib/Drupal/Core/Entity/EntityTypeManager.php(170): Drupal\Core\Entity\EntityTypeManager->getHandler('block_content', 'storage')
#27 /var/www/docroot/core/lib/Drupal/Core/Entity/EntityRepository.php(52): Drupal\Core\Entity\EntityTypeManager->getStorage('block_content')
#28 /var/www/docroot/core/lib/Drupal/Core/Entity/EntityManager.php(501): Drupal\Core\Entity\EntityRepository->loadEntityByUuid('block_content', '8e88c5a4-411e-4...')
#29 /var/www/docroot/core/lib/Drupal/Core/Config/ConfigManager.php(490): Drupal\Core\Entity\EntityManager->loadEntityByUuid('block_content', '8e88c5a4-411e-4...')
#30 /var/www/docroot/core/lib/Drupal/Core/Config/ConfigImporter.php(622): Drupal\Core\Config\ConfigManager->findMissingContentDependencies()
#31 /var/www/docroot/core/lib/Drupal/Core/Config/ConfigImporter.php(496): Drupal\Core\Config\ConfigImporter->processMissingContent(Array)
#32 /var/www/vendor/drush/drush/src/Drupal/Commands/config/ConfigImportCommands.php(237): Drupal\Core\Config\ConfigImporter->doSyncStep('processMissingC...', Array)
#33 /var/www/vendor/drush/drush/includes/drush.inc(232): Drush\Drupal\Commands\config\ConfigImportCommands->doImport(Object(Drupal\Core\Config\StorageComparer))
#34 /var/www/vendor/drush/drush/includes/drush.inc(223): drush_call_user_func_array(Array, Array)
#35 /var/www/vendor/drush/drush/src/Drupal/Commands/config/ConfigImportCommands.php(208): drush_op(Array, Object(Drupal\Core\Config\StorageComparer))
#36 [internal function]: Drush\Drupal\Commands\config\ConfigImportCommands->import('edelman_main', Array)
#37 /var/www/vendor/consolidation/annotated-command/src/CommandProcessor.php(246): call_user_func_array(Array, Array)
#38 /var/www/vendor/consolidation/annotated-command/src/CommandProcessor.php(181): Consolidation\AnnotatedCommand\CommandProcessor->runCommandCallback(Array, Object(Consolidation\AnnotatedCommand\CommandData))
#39 /var/www/vendor/consolidation/annotated-command/src/CommandProcessor.php(150): Consolidation\AnnotatedCommand\CommandProcessor->validateRunAndAlter(Array, Array, Object(Consolidation\AnnotatedCommand\CommandData))
#40 /var/www/vendor/consolidation/annotated-command/src/AnnotatedCommand.php(404): Consolidation\AnnotatedCommand\CommandProcessor->process(Object(Symfony\Component\Console\Output\ConsoleOutput), Array, Array, Object(Consolidation\AnnotatedCommand\CommandData))
#41 /var/www/vendor/symfony/console/Command/Command.php(255): Consolidation\AnnotatedCommand\AnnotatedCommand->execute(Object(Drush\Symfony\DrushArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#42 /var/www/vendor/symfony/console/Application.php(971): Symfony\Component\Console\Command\Command->run(Object(Drush\Symfony\DrushArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#43 /var/www/vendor/symfony/console/Application.php(248): Symfony\Component\Console\Application->doRunCommand(Object(Consolidation\AnnotatedCommand\AnnotatedCommand), Object(Drush\Symfony\DrushArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#44 /var/www/vendor/symfony/console/Application.php(148): Symfony\Component\Console\Application->doRun(Object(Drush\Symfony\DrushArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#45 /var/www/vendor/drush/drush/src/Runtime/Runtime.php(112): Symfony\Component\Console\Application->run(Object(Drush\Symfony\DrushArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#46 /var/www/vendor/drush/drush/src/Runtime/Runtime.php(41): Drush\Runtime\Runtime->doRun(Array)
#47 /var/www/vendor/drush/drush/drush.php(66): Drush\Runtime\Runtime->run(Array)
#48 /var/www/vendor/drush/drush/drush(4): require('/var/www/vendor...')
#49 {main}

Thinking back on it, I think I figured this out and that's why I went with the StorageComparer route. In using a different StorageComparer, I was able to disable any and all comparison checks to any given collection.

Maybe with @bircher's idea of using a different Filter altogether that implements the method he brought up, this can be alleviated. I'm now implementing arbitrary language enablements on another ACSF subscription so I'm revisiting this, I'll spend some time on it.

lpeabody’s picture

Proof of concept implementation (with some caveats, see below code block):


namespace Drupal\edelman_custom\Plugin\ConfigFilter;

use Drupal\config_filter\Plugin\ConfigFilterBase;

/**
 * Provides a filter that skips language collections.
 *
 * @ConfigFilter(
 *   id = "collection_ignore",
 *   label = "Config Collection Ignore",
 *   weight = 101
 * )
 */
class CollectionIgnore extends ConfigFilterBase {

  /**
   * {@inheritdoc}
   */
  public function filterGetAllCollectionNames(array $collections) {
    $collections = array_filter($collections, function ($collection) {
      if (fnmatch('language.*', $collection)) {
        return FALSE;
      }
      return TRUE;
    });
    return $collections;
  }

}

This seems to maintain the active state of language collections in the database. The language patterns will eventually be configurable (I plan to work on this tomorrow night during the Boston Drupal Meetup).

However, with one caveat that I don't think is addressable by this module, is that due to how StorageComparer works (https://cgit.drupalcode.org/drupal/tree/core/lib/Drupal/Core/Config/Stor...), on export the currently active language collection set will be always be exported. This can be a relatively large annoyance as this messes with our export diff when we don't actually care about the language collections. I only want to see what I care about changing.

So IMHO, this separate filter approach works in terms of not altering the active language collection state (the primary goal), but there is a significant QOL issue during the course of development when you're working with configuration and exporting configuration and trying to pick apart the export diff to confirm the configuration that is being exported actually reflects changes that you intentionally made.

EDIT: A theoretical workaround for this is to make the active storage filterable. Will look into this.

lpeabody’s picture

Status: Needs work » Active

Did a little more work on this tonight. My findings and proof of concept boils down to the following points:

  1. CollectionIgnore filter must apply to the sync storage as well as the active storage. Working example https://gist.github.com/lpeabody/a28026d31131e5c6ff83372baef0932b.
  2. Assuming you are using Drush to import/export configuration, you'll want to replace the config:import and config:export commands so that you can replace each commands config storage data member with it's filtered storage equivalent (using only filtered storage that applies to the active storage). Working example https://gist.github.com/lpeabody/ae172a1da52a311b4581a49eccc69c83.

The above works perfect for me and allowed me to get rid of my bastardized StorageComparer class (yay!).

Next step is to get the CollectionIgnore filter configurable via the module. Not sure if it's best to create a submodule for this or to just include it natively with config_ignore though... thoughts?

lpeabody’s picture

Assigned: lpeabody » Unassigned
Status: Active » Needs review
FileSize
6.09 KB
5.75 KB

I attached two patches.

  1. Adds a new filter strictly for storage collections.
  2. Module that replaces the config import/export Drush 9 commands. Specifically, when enabled, the import/export commands will now filter on the active storage as well as the sync storage.

The filter applies to two storages by default: config.storage.sync and also config.storage.active. The config.storage.active alias does not do anything out of the box because all existing filtered storages are only ever applied against the config.storage.sync alias.

However, when the config_ignore_drush module is enabled, the config import/export commands will now take into account the collection filter when comparing BOTH the active/sync storages via StorageComparer as opposed to just the sync storage. I found this to be necessary in the event I synchronized with a database (which may have an arbitrary set of languages enabled) and performed an import/export with language.* as the only active collection ignore rule. During that import/export, the collections in active storage would always be compared against an empty set of sync collections. So on export it would always want to create the active storage language collections, and on import it would always want to delete all active storage language collections.

To get the behavior I wanted, I had to ensure that StorageComparer in the Drush commands were taking into account the ignored collections on the active storage as well. The only way to accomplish this was to override the Drush commands and then override the getConfigStorage() function in each (per the patch).

I'll set this to Needs Review as this is working well for me at the moment. Looking forward to working out the finer details.

lpeabody’s picture

Fixes issue with fatal error when the ignore collections configuration value hasn't been actually saved to configuration yet.

bircher’s picture

Status: Needs review » Needs work

Hi @lpeabody

Thanks for the patches and digging into how config filters work.
Unfortunately though, I think you are not on the right track.

The conclusion based on your assumption is correct, but then you could go one step further and not do any filtering and instead just go all the way with changing the drush command. Drush in essence does the following on export:

  • delete all from sync
  • read all from active and write to sync
  • loop over collections in sync and remove all in it
  • loop over collections in active and write to corresponding collection in sync

If you want to ignore collections for the export all you have to do is skip the last two steps. This is what drupal console did in an early version and it was fixed because in general that is a bug.
The import then need messing with the active storage as you discovered.

But all that is not in line with how config_ignore works and won't work with the UI or drupal console.

Config Ignore works by filtering what is read from the sync store in such a way that it seems that there is no difference to what the active store contains.
So for ignoring all collections the filter should return the same collection names as the active store has. And when the filter is used on the collection it should filter all the read operations to return what the active storage has fo that collection.
And for ignoring on export the filter would not delete from collections and would not write anything when the filter is filtering a collection.
But that is quite advanced to get it right and needs good testing.
It will become much simpler with the changes we are trying to bring to core with CMI 2.0 But unfortunately I don't know how far off that is.

johnpicozzi’s picture

I am also looking for this feature. My use case is with Lingotek Translations. Our client is translating config on their stage server and we don't want to blow that away on deploys. So ignoring the config/language folder/config would be helpful.

I found this module https://www.drupal.org/project/config_ignore_collection however it doesn't not look well supported or maintained. This should be a feature of Config Ignore in my opinion. It would be great if the patch above could be updated to work the same way config ignore does.

lpeabody’s picture

Hey John, I might be able to tackle this in the next few weeks with an upcoming workload. I'm hoping it doesn't take more than 3-4 hours. We'll see, but yeah I'd like to get this working normally as well.

johnpicozzi’s picture

Any update here?

This issue has come up again with placeholder text that is being translated after applying https://www.drupal.org/project/drupal/issues/2546212

Our client is translating on their stage environment. However, our deploys blow away that translation.

lpeabody’s picture

@johnpicozzi, I haven't really had the time I need to refine the work I posted in #18. That said, the work from #18 is powering three different ACSF codebases fairly effectively, it's just that it is specific to Drush. If that fits your config import/export use case, I would recommend giving it a whirl. I will be at the Boston meetup tomorrow evening if you would like to attend and discuss in person, or we can connect on Drupal Slack to talk things out there...

johnpicozzi’s picture

Ok, after a day of testing and some help via Drupal Slack from @lpeabody (Thank You!) I have this working. The key was the patch from #18 with the Drush patch from #17 and ensuring the Config Ignore Drush Commands module was turned on. I would say this is needed functionality of Config Ignore and this should be RTBC ASAP.

I ran into a strange issue with Config Split where having a language folder in my split folder prevented this from working. However, that feels like more of a problem with how Config Split and Config Ignore interact. Once possible solution would be to use the Config Split Ignore module. In my use case I just added the language folder to my git ignore.

joey-santiago’s picture

We were using this patch at #17... with the latest update to 2.2 the install hook added with the patch conflicts.

So here's a new one.

a.dmitriiev’s picture

I think joey-santiago accidentally forgot file src/Plugin/ConfigFilter/CollectionIgnore.php. Here is re-rolled patch.

rajanvalecha12’s picture

I tried using the patch from #26 and drush patch from #17. It worked well on my local but failed on travis as the travis was using drush cst (config status) command to match configuration from db and active storage. Thus, I had to override the drush cst command as well. Here's the patch if someone needs the same functionality.

bircher’s picture

RE: #27 This is because the filter from #26 is wrong.
In general adding a drush command to config_ignore is the wrong approach, so if it is necessary then the patch is wrong.

As I wrote in #19 this is now easier if we do this in the 3.x version of config ignore. Or alternatively create a 2.x version of config_ignore_collection and use an event subscriber just as 3.x of config_ignore does now.
I can help review that in case.

rajanvalecha12’s picture

RE: #28
Thanks for your inputs. I have tried to accomplish this in 3.x using the same event subscriber and implementing the logic as detailed in #19. However, I still had to override the Drush commands to use the export storage service for config export and status check as detailed in this change record. So that appropriate events could be dispatched. Also, I did override the config import to use 'config.import_transformer' to transform the source storage and hence dispatching the appropriate event.

While using the 3.x version, I found a few issues with array checks so I have applied them accordingly and it seems to be working fine for me now.

@bircher, I would be happy to have you review this.

rajanvalecha12’s picture

rajanvalecha12’s picture

Version: 8.x-2.x-dev » 8.x-3.x-dev
rajanvalecha12’s picture

bircher’s picture

Status: Needs work » Postponed

Ok I think since this is much simpler in 3.x and the issue is now tagged agains 3.x this is postponed until 3.x works again #3117694: Make all available tests pass

and RE #29
The drush commands are not needed because drush 10 dispatches the events and 3.x is only compatible with core 8.8+ and drush 10+.
If you use drush 8 or 9 or drupal core 8.7 none of this will work.

for 2.x the patch from #26 is wrong because it doesn't do what I wrote in #19:

So for ignoring all collections the filter should return the same collection names as the active store has. And when the filter is used on the collection it should filter all the read operations to return what the active storage has fo that collection.
And for ignoring on export the filter would not delete from collections and would not write anything when the filter is filtering a collection.

jefuri’s picture

Version: 8.x-3.x-dev » 8.x-2.2
Status: Postponed » Needs review
FileSize
7.3 KB

Took me a couple of hours, reading through the patches, how config_filter works. But I might have fixed it using the "config ignore" and "config filter" way.

By comparing the collection name in the source with the one that we might want to ignore, we can execute the same kind of comparison on active storage of that collection.

bircher’s picture

Status: Needs review » Needs work

Fantastic! this is much more in line with how it can work.
However you can do it in a much more simple way:

Extend the base class from config filter and then;

+++ b/src/Plugin/ConfigFilter/CollectionIgnore.php
@@ -0,0 +1,128 @@
+    if (!$this->matchCollectionName()) {
+      return $data;
+    }

Do this in every read-related method.

Otherwise return what the active store returns for read operations, (don't delete or write to the active store! if you want to also filter on export you have to filter the delete and deleteAll and prevent the deletion when it is your ignored collection, and then filter on write by returning what you read from the source, but I would recommend doing this step by step).

The exception is filterGetAllCollectionNames where you need to array merge the ignored collections that exist in the active store. And most importantly the filterCreateCollection which you can copy from the IgnoreFilter.

And please write tests for it otherwise I don't know if the behaviour is that you expect.

jefuri’s picture

I don't really get what you mean with how it can be more simple. At least, from my current understanding.

What I did was:
- I used the setup of the "IgnoreFilter" to see where they "check" on situations to prevent importing.
- There I overridden the FilterRead and FilterReadMultiple to incorporate my logic for reading from the active collection, if the collection should be ignored.
- Same for filterExists and filterListAll

So my questions are:
- Why implement delete if the IgnoreFilter does not?
- What can be simpler?

Maybe I am missing something...

I could extend the base class, but that would mean duplicate could on the __construct and filterCreateCollection in comparison to IgnoreFilter.
But sure, this would make it more "separate".

Tests... I suck at tests, for now. And have to find the time to do this.
It would fix a lot of deployment issues for us, so maybe the boss will sponsor some time to do this.

bircher’s picture

Yes you are right! Don't delete on export, that is another issue.

What can be simpler? well it depends on how you expect it to work, if there is config in the sync storage for a collection you ignore but it is not in the active store then it is going to be imported (as config ignore 2.x currently works) then it is probably simple enough. (you don't need the extra function to get the active storage in the collection because it already is since each collection will have its cloned filter.

But yes just copy the one line from filterCreateCollection and extending the base class is much better, because then you don't inherit any complexity that then gets hidden.

Also filterExists needs the check for the ignored collection.

jefuri’s picture

I am trying to wrap my head around this:

What can be simpler? well it depends on how you expect it to work, if there is config in the sync storage for a collection you ignore but it is not in the active store then it is going to be imported (as config ignore 2.x currently works) then it is probably simple enough. (you don't need the extra function to get the active storage in the collection because it already is since each collection will have its cloned filter.

What can be simpler? well it depends on how you expect it to work, if there is config in the sync storage for a collection you ignore but it is not in the active store then it is going to be imported (as config ignore 2.x currently works) then it is probably simple enough.

This is what currrently seems to happen (needs tests ofcourse).

(you don't need the extra function to get the active storage in the collection because it already is since each collection will have its cloned filter.

Because as I understoond, the active storage that the IgnoreFilter uses, is the default collection. Because it always uses:

$container->get('config.storage'). 

So I still need to get the active collection storage right (for a language for instance)?

/**
   * Get the active storage belonging to the source collection.
   *
   * @return \Drupal\Core\Config\StorageInterface
   *   The Active Collection Storage.
   */
  protected function getActiveCollectionStorage() {
    return $this->active->createCollection($this->getSourceStorage()->getCollectionName());
  }

And I can only use $this->active->createCollection($this->getSourceStorage()->getCollectionName()), once setSourceStorage is called.
Tried to set it in the construct, but it gave an error because $this->getSourceStorage() was null.

bircher’s picture

I think that is another reason why you should not extend the IgnoreFilter and instead copy the things you need. It will make it very clear what is going on.
The create method instantiates the first and default filter. I passes the active storage form the container to the plugin. But then the filterCreateCollection method creates a new filter and it passes the active storage in the new collection to it. so your filter in the collection mode has $this->active also in the collection.

And the setSourceStorage is called by config_filter when the storage is set up (which it also is for each collection). so you can be sure that in any filter method the storage is set. (not in the constructor of course)

What I am trying to say is that this is ok:

  protected function getActiveCollectionStorage() {
    return $this->active;
  }

So you can just skip it. if you had tests for this functionality then you could just switch this out and see if the tests still pass...
Tests are a very useful development tool. Which have the added benefit of continually ensure that it works in the future thanks to the drupal CI.

jefuri’s picture

Wow... I was typing again that I could not see it, writing the quoted text below and stuff.

You sure? I will try that out then.
Because my perception of it was that $this->active is the main storage (the sync folder itself) and not the collection store (language/en for instance). It is not changed when filterCreateCollection is called, $this->active in the default, and instantiated plugin for each collection is always the same right?

But then when I was adding the code examples to demonstrate what I meant... I saw it haha.

  /**
   * {@inheritdoc}
   */
  public function filterCreateCollection($collection) {
    return new static($this->configuration, $this->pluginId, $this->pluginDefinition, $this->active->createCollection($collection));
  }

$this->active->createCollection($collection) is passed as active, dit not see that haha. Changed it in the new patch.

Needs test still of course. But I think we can start doing this to wrap this up.

aponomarenko’s picture

@jefuri thanks for the great #40 patch, but there is already config_ignore_update_8202 function (config_ignore.install) in 8.x-2.2 version, may you please check and update the patch?
https://git.drupalcode.org/project/config_ignore/-/blob/8.x-2.2/config_i...

jefuri’s picture

Done! Nice catch @aponomarenko

Rade’s picture

Patch from #42 seems to work nicely!

There are some linting issues to be addressed, however. Please see https://www.drupal.org/pift-ci-job/1641520

mrinalini9’s picture

Assigned: Unassigned » mrinalini9
mrinalini9’s picture

Assigned: mrinalini9 » Unassigned
Status: Needs work » Needs review
FileSize
8.91 KB
458 bytes

Fixing PHPLint issue in patch #42, please review.

Rade’s picture

Status: Needs review » Reviewed & tested by the community

Thanks @mrinalini9, I can confirm that patch #45 works!

The last submitted patch, 32: config-ignore-collections-2973431-31.patch, failed testing. View results
- codesniffer_fixes.patch Interdiff of automated coding standards fixes only.

sahil432’s picture

@mrinalini9, After applying this patch i added language.* in Configuration storage collections to ignore field but still all language collections are appearing in Synchronize page with n number of config under each collection and they are not showing below "The following configuration entities are ignored due to the Config Ignore Settings and therefore not displayed in the list above".

goodDenis’s picture

Thanks! It works for me.

botanic_spark’s picture

+++ b/config_ignore.install
@@ -13,9 +13,17 @@ function config_ignore_update_8201() {
+  $config = \Drupal::configFactory()->getEditable('config_ignore.settings');

Why is this update function added under existing 8202, and what was previously 8202, now is 8203?

For folks that already had module, update hooks will not be executed correctly.

jefuri’s picture

Status: Reviewed & tested by the community » Needs work

Good catch, I think it is because this patch started when there wasn't a update hook 8202, but during development of the patch it was.
I corrected it incorrectly, it should indeed be 8203.

jefuri’s picture

Status: Needs work » Needs review
FileSize
8.64 KB
bircher’s picture

Status: Needs review » Needs work

Nice work!

A few comments:

  1. +++ b/src/Plugin/ConfigFilter/CollectionIgnore.php
    @@ -0,0 +1,172 @@
    + *   storages = {"config.storage.sync", "config.storage.active"},
    

    I am not sure why we would add config.storage.active here.

  2. +++ b/src/Plugin/ConfigFilter/CollectionIgnore.php
    @@ -0,0 +1,172 @@
    +    if (!$this->matchCollectionName()) {
    +      parent::filterExists($name, $exists);
    +    }
    ...
    +    if (!$this->matchCollectionName()) {
    +      parent::filterListAll($prefix, $data);
    +    }
    

    This is missing a return

  3. +++ b/src/Plugin/ConfigFilter/CollectionIgnore.php
    @@ -0,0 +1,172 @@
    +    // Add active collection names as there could be ignored config in them.
    +    return array_merge($collections, $this->active->getAllCollectionNames());
    

    I think we should only add the collections from the active store that we also ignore, and then we can also de-duplicate them with array unique

nicothezulu’s picture

nicothezulu’s picture

nicothezulu’s picture

nicothezulu’s picture

Attaching the solution to get this working together with Support for export filtering via Drush - 2857247.
The previous patch at #54 & #56 doesn't work as expected, this one is the correct version instead.
the patch order is:
1) support-for-export-2857247-24.patch
2) config-ignore-collections-2973431-57.patch

ethomas08’s picture

Re-rolled the supplementary drush commands patch file to work with Drush 10, since the change from 9 to 10 introduced breaking changes.

sokru’s picture

Version: 8.x-2.2 » 8.x-2.x-dev
FileSize
8.63 KB
1020 bytes

Tested #52 with #53.1 + #53.2 (patch added). Worked nicely for my use case, expect for custom languages with language code containing dash. Since it worked with contrib languages with dash (e.g. zh-hant), I would not expect this niche use case to be solved in this issue.

lpeabody’s picture

FileSize
9.52 KB

Similar situation as in #59, though this is with the export patch and the storage collections ignore work applied on top of 2.3 instead of 2.x-dev. The interdiff is the same as in #59.

alejomc’s picture

#60 has some issues, created this new one to be applied over the 2.x-2.3.

alejomc’s picture

lpeabody’s picture

@alejomc what are the issues you ran into with the patch from 60?

alejomc’s picture

@lpeabody,

rejected on: src/Form/Settings.php and on config/schema/config_ignore.schema.yml

--- src/Form/Settings.php
+++ src/Form/Settings.php
@@ -84,6 +94,9 @@ Examples: <ul>
     $config_ignore_settings_array = array_filter($config_ignore_settings_array);
     $config_ignore_settings_array = array_values($config_ignore_settings_array);
     $config_ignore_settings->set('ignored_config_entities', $config_ignore_settings_array);
+    $config_collection_storage_array = preg_split("[\n|\r]", $values['ignored_config_collections']);
+    $config_collection_storage_array = array_filter($config_collection_storage_array);
+    $config_ignore_settings->set('ignored_config_collections', $config_collection_storage_array);
     $config_ignore_settings->set('enable_export_filtering', $values['enable_export_filtering']);
     $config_ignore_settings->save();
     parent::submitForm($form, $form_state);
--- config/schema/config_ignore.schema.yml
+++ config/schema/config_ignore.schema.yml
@@ -7,6 +7,11 @@ config_ignore.settings:
       label: 'List of ignored configurations'
       sequence:
         type: string
+    ignored_config_collections:
+      type: sequence
+      label: 'List of ignored configuration storage collections'
+      sequence:
+        type: string
     enable_export_filtering:
       type: boolean
       label: 'Enable export filtering'

Also, I see the `CollectionIgnore` is added multiple times, so only added one instance in "src/Plugin/ConfigFilter/CollectionIgnore.php"

alejomc’s picture

@lpeabody, silly question at this point, but shouldn't it be ignored as well on drush cex ?, since I see the collection is ignored on drush cim but unfortunately no on drush cex. either path #60 or # 61

alejomc’s picture

never mind, I was missing 'enable_export_filtering: true' property in 'config_ignore.settings'. worked for me. thanks.

alejomc’s picture

u_tiwari made their first commit to this issue’s fork.

JvE’s picture

#60 applies when you've also applied the patch from https://www.drupal.org/project/config_ignore/issues/2857247
#61 does not apply when you have that patch, and it includes unrelated export-ignore stuff if you do not have that patch.

What is needed is a patch that applies to an unpatched config_ignore and does not include unrelated stuff that causes collisions with the export-ignore patch.

kmonty’s picture

Unsure what u_tiwari is trying to accomplish in their PR, but it seems to be completely unrelated to this issue (it creates a `config_ignore_drush` submodule).

kmonty’s picture

Also noting that none of the patches in here apply to 3.0-beta1. When upgrading core to 9.3.0, config_ignore on the latest 2.x branch ends up deleting a lot of user roles from config, generally causing a heap of issues.

It appears the only path forward is to:

  1. Update to config_ignore 3.x
  2. Port this patch to 3.x
jozzy_a’s picture

What combination is working for others?
Is the approach to use the patch on comment #61 and upgrade config_ignore to 2.3?

Then use the following code in custom module to invoke that patch?

function hook_config_ignore_collections_alter(array &$collections) {
  $collections[] = 'language.*';
}

function hook_config_ignore_settings_alter(array &$settings) {
  $settings[] = 'language.negotiation';
  $settings[] = 'language.entity.*';
}
rcodina’s picture

@jozzy_a I confirm that patch on #61 cleanly applies over config_ignore 2.3.

Once patch is applied, I configure the module via UI (admin/config/development/configuration/ignore):

Configuration entity names to ignore:

language.negotiation
language.entity.*

Configuration storage collections to ignore:
language.*

However, language collections still not ignored on "drush cim". Does it work for you?

@kmonty I agree that a patch for config_ignore 3.x is needed.

thetwentyseven’s picture

I have followed @rcodina instructions:

  1. Add the patch v2-3 of #61 comment: applied correctly
  2. Run drush updb without any error
  3. Add language.* to the store collections to ignore, and language.negotiation and language.entity.* in entity names to ignore in the UI,
  4. Add a new translation
  5. Did drush cim

After the last step the translation is gone.

phma’s picture

Status: Needs work » Needs review
FileSize
7.74 KB

Updated #32 to work with latest config_ignore 3.x. It seems to work on a clean site install.

phma’s picture

Added install config and fixed wrong update counter.

phma’s picture

I tried adding some basic test coverage.

phma’s picture

I've added static caching for collections and refactored the patch to match the logic of the getRules method.

While it's nice for a patch to not touch too much of the core functionality, I currently see a lot of duplication happening in the code. Maybe there are more elegant ways to achieve this? Or is it better to merge as is and to the refactoring later?

Megha_kundar’s picture

Version: 8.x-3.x-dev » 8.x-3.0-beta1
Assigned: Unassigned » Megha_kundar
Status: Needs review » Needs work
Issue tags: +Needs reroll

Patch doesn't apply for 8.x-3.0-beta1

Megha_kundar’s picture

Assigned: Megha_kundar » Unassigned
Status: Needs work » Needs review
Issue tags: -Needs reroll

sorry I just checked in new release i.e 8.x-3.0-beta1 there is no commit available https://www.drupal.org/project/config_ignore/issues/3226493 But, this commit is available in 8.x-3.0 branch. After applying https://www.drupal.org/project/config_ignore/issues/3226493 patch then we can apply the above patch.

gaurav.goyal’s picture

Getting the below errors after applying the patch and trying to export config

 [warning] array_merge(): Expected parameter 1 to be an array, null given SplitFilter.php:161
 [warning] array_merge(): Expected parameter 1 to be an array, null given SplitFilter.php:162
 [warning] uksort() expects parameter 1 to be array, null given SplitFilter.php:172
 [warning] array_merge(): Expected parameter 1 to be an array, null given SplitFilter.php:161
 [warning] array_merge(): Expected parameter 1 to be an array, null given SplitFilter.php:162
 [warning] uksort() expects parameter 1 to be array, null given SplitFilter.php:172
gaurav.goyal’s picture

Patch in #61 cleanly applies to config_ignore 2.x, and doesn't throw any errors

joelstein’s picture

The patch in #79 worked for me with 8.x-3.0-beta1. Some notes:

1) I first applied #3226493-4: Clear Config Filter plugin cache to update from 2.x to 3.x (committed after beta1 was released), then the patch in #75. Otherwise, the update scripts conflicted, and the patch wouldn't apply.

2) The update script added in #75 sets the newly-added "config_ignore.settings:ignored_config_collections" config to an empty array. Since I am bundling this in a deployment that has an existing language configuration, I added an update script to my custom module and run it first. Example:

/**
 * Implements hook_update_dependencies().
 */
function my_module_update_dependencies() {
  $dependencies['my_module'][9401] = ['config_ignore' => 8302];
  return $dependencies;
}

/**
 * Sets Config Ignore's initial ignored collections.
 *
 * This must run after config_ignore_update_8302().
 */
function my_module_update_9401() {
  $config = \Drupal::configFactory()->getEditable('config_ignore.settings');
  $config->set('ignored_config_collections', [
    'language.*:my_module.settings',
    'language.*:system.site:name',
  ])->save();
}
phma’s picture

Version: 8.x-3.0-beta1 » 8.x-3.x-dev

awolfey’s picture

Status: Needs review » Needs work

#79 is working for me, but throws warnings when no collections have been added.

[warning] Invalid argument supplied for foreach() ConfigIgnoreEventSubscriber.php:391
[warning] Invalid argument supplied for foreach() ConfigIgnoreEventSubscriber.php:291

sdstyles’s picture

Re-roll for 8.x-3.0-beta1

g_miric’s picture

Status: Needs work » Reviewed & tested by the community

LGTM!

j.cowher’s picture

Thanks for this patch! I also needed to figure out how to ignore translated configuration and #78 worked great. We are using 3.0-beta2.

hchonov’s picture

FileSize
18.5 KB
554 bytes

Re-roll since another hook_update_N() got in already. I also adjusted the patch to respect previously configured settings instead of reseting them since now the update will get executed one more time for sites that had the previous patch.

nagy.balint’s picture

Thank you for the patch!
It works for us so far.

nsciacca’s picture

The patch in #91 no longer applies to 3.x-dev and it's not an easy re-roll... the split of modes with Basic, Intermediate, and Advanced complicates this.

bircher’s picture

Status: Reviewed & tested by the community » Needs work

Yes the patch here needs to be re-worked. And I would argue the approach needs to be re-thought.

But if you look at the code in 3.x-rc1 you will see that it was refactored with this issue in mind.

To achieve the same purpose (ignoring config in certain collections), I think it would be easier to integrate them with the other patterns.

You know that now you can ignore patterns with their config name and optionally separated with a : also ignore just parts of it. If you leave the partial part out then it is essentially everything, or *.

I think we could do the same for collections. I don't know what the best separator would be. Let's assume for this argument that we settled on | as the separator, then imagine:
lang.de|config_name:some.part and if you omit the language part it is implied just * and if you want your config to be ignore just in the default collection you would write |config_name

So you could also ignore lang.*|* and ~lang.en|* which would mean ignore all languages except for English. This would just make it more difficult to then also ignore something but not everything in the english translations. But to be honest.. I think that is an edge case that we could be ok with. I don't think we need ~~ to exclude excludes... But we could in a different issue.

HitchShock’s picture

Made a quick patch for the RC version (without tests for now).

Now we can use | separator for collections.
For example: language.*|*

bircher’s picture

Hi
Yes the patch from #95 is precisely what I had in mind.

Tests should be pretty straightforward to write, one can just add more test cases to where all the other things are. They already have languages set up for this exact reason.

joao.ramos.costa’s picture

#95 Worked for me for 3.1 release.
Upgrading from 2.4 and after settings update it was pretty straightforward,

Thanks a lot!

j.cowher’s picture

Also confirming that #95 worked for me for 3.1 release.

As a note for others - you'll need to update your config_ignore.settings after applying the patch from #95.

Examples

  • * (will ignore everything)
  • ~webform.webform.contact (will force import for this configuration, even if ignored by a wildcard)
  • user.mail:register_no_approval_required.body (will ignore the body of the no approval required email setting, but will not ignore other user.mail configuration.)
  • language.*|* (will ignore all language collections)
  • language.fr|* (will ignore all fr language collection)
  • language.fr|field.field.* (will ignore all fr field translations)
  • ~language.fr|field.field.media.file.field_media_file (will force import for certain field translation)
j.cowher’s picture

Status: Needs work » Reviewed & tested by the community

Changing the status of this issue to "Reviewed & tested by the community" per the Issue Status Field documentation.

bircher’s picture

Status: Reviewed & tested by the community » Needs work

Before this can be committed someone needs to add a couple of test cases here:

https://git.drupalcode.org/project/config_ignore/-/blob/8.x-3.x/tests/sr...

It can be a simple configuration with a couple of the language examples.

HitchShock’s picture

Status: Needs work » Needs review
FileSize
5.78 KB

Added tests to the patch

HitchShock’s picture

Hide all outdated patches and made a PR

c_archer’s picture

Status: Needs review » Reviewed & tested by the community

The latest patch worked for me.

g_miric’s picture

The latest patch worked for me too!

g.mustapha’s picture

this works for me

HitchShock’s picture

@gmustapha not sure why you readded patch #79, this is a patch for 2.x and 3.0-beta2 but we need a patch for 3.x already.
If you need a patch for the old version you can just use the older one (#79).

joelstein’s picture

Status: Reviewed & tested by the community » Needs work

I have a use case that the patches in #95 and #101 don't resolve.

For example, I'd like to ignore the site name in language collections.

I expected something like this to work:

- language.*|system.site:name (doesn't work)

FYI:

- language.*|system.site (works, but it ignores too much)
- language.*|system.site.* (doesn't work, though the help text added in #95 suggests it should)

  • bircher committed 24e2898e on 8.x-3.x
    Issue #2973431 by HitchShock, bircher: Ignore configuration storage...
bircher’s picture

Title: Ignore configuration storage collections? » Ignore configuration storage collections
Status: Needs work » Fixed

Thank you everyone for contributing to this long standing issue!
I was never really happy with how it worked in 2.x, but I am very happy to see that the architecture of 3.x makes this much simpler and yet much more flexible to configure.

I added and changed some stuff based on the great work from patch in #101 and I added a test for #108 which passes so, if that doesn't work then we need to find a better test and fix it as a bug in the next release.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.