Problem/Motivation

The blacklist/greylist configuration is not respected when importing configuration.

Steps to reproduce:

  1. Install a site using standard install profile
  2. Add all block configuration to the blacklist/graylist
  3. Export configuration using drush csex
  4. Exported config does not contain excluded block config as expected
  5. Import configuration using drush csim
  6. Visit the block layout page. All blocks are gone

Proposed resolution

Extend Core's ConfigImporter with ImportFilters and respect the ImportFilter results.

Remaining tasks

Write patch
Review patch
Commit

User interface changes

None

API changes

None

Data model changes

None

Attached are 2 patches. One based on current HEAD and one based on HEAD + https://www.drupal.org/files/issues/2806029-3_0.patch

Comments

legolasbo created an issue. See original summary.

legolasbo’s picture

Attribute patch(es) to Nedbase

bircher’s picture

Status: Needs review » Postponed (maintainer needs more info)

Thanks for the issue report and thanks also for the patch.
The patch is quite big and re-shuffles the code quite a bit, while that is not a problem as such of course, I am not convinced yet that extending the ConfigImporter is necessary.
I just did the steps you mentioned in the issue and all the blocks were where they are supposed to be.

Could you provide a patch with an automated test that demonstrates the bug?

Thanks a lot for the contribution!

pilulu’s picture

Thanks a lot for you're contributions @bircher and @legolasbo
It works well for me,

I applied the patches https://www.drupal.org/files/issues/2806029-2.patch and https://www.drupal.org/files/issues/does-not-ignore-during-import-based-...
from the project commit #97d238714286e59b1f9881d8164442c0f170599a

My use case :

I've included in my project Yamlform which export each forms as config structure.
My problem is to let the final customer create forms on the production server without deleting them on config import.

I really need this evolution, and I think a lot of people need it.

Thanks

pilulu’s picture

StatusFileSize
new22.62 KB

I've updated the patch based on 2806029 which is now https://www.drupal.org/files/issues/2806029-3.patch
to be compatible as the last HEAD version of 1.x-dev #6cde9b0f653f5137fa16d8d79812d9bd8fcd0535

pilulu’s picture

Issue summary: View changes
pilulu’s picture

Status: Postponed (maintainer needs more info) » Needs review

Status: Needs review » Needs work

The last submitted patch, 5: does-not-ignore-during-import-based-on-2806029-3.patch, failed testing.

pilulu’s picture

Issue summary: View changes
Status: Needs work » Needs review
StatusFileSize
new22.55 KB

Sorry for the failing fix
Here the good version

Status: Needs review » Needs work

The last submitted patch, 9: does-not-ignore-during-import-based-on-2806029-3.patch, failed testing.

pilulu’s picture

StatusFileSize
new0 bytes

Mixed with updated does-not-ignore-during-import-based-on-2806029-3.patch and https://www.drupal.org/files/issues/2806029-3_0.patch
I've created anew patch, which ignored well configuration at import with wildcards.

Why ?
I had problem on YamlForm Form with existing results linked to the form.
When i tried to update another structure configuration, it exploded with the error message like this
'You have contents that need to be removed before importing configuration' (the Ingnored form results)

Improvements
Just before the import, i export the ignored configurations stored in the database configuration storage.
Thats allow the importing procedure to see that there is no changes for the ignored configuration
At the end of the procedure, i clean the previously exported configurations

I also added a dump of the errors to highlight the detailed error message instead of throwing only a generic message (which af no detail of the error cause)

Defaults
This patch is a trick and not a clean integration.
But it works great for me.
This patch take only charge of exported configuration in the primary storage.

pilulu’s picture

Status: Needs work » Needs review
StatusFileSize
new29.72 KB

The good patch
sorry for the inconvenience

Status: Needs review » Needs work

The last submitted patch, 12: wildcards-and-ignored-pattern-import.patch, failed testing.

bircher’s picture

Status: Needs work » Postponed (maintainer needs more info)

Thank you for the patches.
Unfortunately the CI bot seems to have some problems with them.

But before more work goes into this I would really like to have a case that doesn't work, preferably with an automated test. Or at least attach the config_split configuration and explain all the steps as in the original issue description. (in the original issue description there are good steps to reproduce, but it worked for me).

I suspect that it is related to the graylist that is so far poorly understood and poorly documented.
I will test also the yaml forms, but generally graylisting entities is a dangerous endeavor because the dependencies are not automatically also graylisted (on purpose).

ayalon’s picture

Does this patch work with Webform module? So I can greylist all newly created Webforms somehow?

pilulu’s picture

Yes ayalon, it works
I justed hadn't time to make tests on patch

ayalon’s picture

Nice! Looks like I'm on the way in finding a solution for a long standing issue! Thx for all efforts!

bircher’s picture

Status: Postponed (maintainer needs more info) » Closed (cannot reproduce)

I am closing this issue because the last few improvements to the graylist feature should make it more clear.

In addition the patch here will continue to have to be re-rolled and it contains changes I am very reluctant to make because they make it impossible to continue to work with the native drush commands.

The documentation still needs to be improved of course so a patch on that would be welcome.
If you have a bug that has a related title, please open a new issue and include detailed steps to reproduce.

PS: Webforms works with beta2 without any issues as far as I have tested them.