A config ignore pattern entry cannot contain both, '~' and '*'.

Created on 1 June 2023, about 1 year ago
Updated 13 January 2024, 6 months ago

Problem/Motivation

I was doing some module updates and suddenly I got a fatal error that completely broke my local site.

LogicException: A config ignore pattern entry cannot contain both, '~' and '*'. in Drupal\config_ignore\EventSubscriber\ConfigIgnoreEventSubscriber->getRules() (line 288 of modules/contrib/config_ignore/src/EventSubscriber/ConfigIgnoreEventSubscriber.php).
Drupal\config_ignore\EventSubscriber\ConfigIgnoreEventSubscriber->getIgnoredConfigs(Object) (Line: 141)
Drupal\config_ignore\EventSubscriber\ConfigIgnoreEventSubscriber->transformStorage(Object, Object) (Line: 106)
Drupal\config_ignore\EventSubscriber\ConfigIgnoreEventSubscriber->onImportTransform(Object, 'config.transform.import', Object)
call_user_func(Array, Object, 'config.transform.import', Object) (Line: 142)
Drupal\Component\EventDispatcher\ContainerAwareEventDispatcher->dispatch(Object, 'config.transform.import') (Line: 120)
Drupal\Core\Config\ImportStorageTransformer->transform(Object) (Line: 223)
Drupal\config\Form\ConfigSync->buildForm(Array, Object)
call_user_func_array(Array, Array) (Line: 536)
Drupal\Core\Form\FormBuilder->retrieveForm('config_admin_import_form', Object) (Line: 283)
Drupal\Core\Form\FormBuilder->buildForm(Object, Object) (Line: 73)
Drupal\Core\Controller\FormController->getContentResult(Object, Object)
call_user_func_array(Array, Array) (Line: 123)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}() (Line: 580)
Drupal\Core\Render\Renderer->executeInRenderContext(Object, Object) (Line: 124)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->wrapControllerExecutionInRenderContext(Array, Array) (Line: 97)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}() (Line: 169)
Symfony\Component\HttpKernel\HttpKernel->handleRaw(Object, 1) (Line: 81)
Symfony\Component\HttpKernel\HttpKernel->handle(Object, 1, 1) (Line: 58)
Drupal\Core\StackMiddleware\Session->handle(Object, 1, 1) (Line: 48)
Drupal\Core\StackMiddleware\KernelPreHandle->handle(Object, 1, 1) (Line: 106)
Drupal\page_cache\StackMiddleware\PageCache->pass(Object, 1, 1) (Line: 85)
Drupal\page_cache\StackMiddleware\PageCache->handle(Object, 1, 1) (Line: 48)
Drupal\Core\StackMiddleware\ReverseProxyMiddleware->handle(Object, 1, 1) (Line: 51)
Drupal\Core\StackMiddleware\NegotiationMiddleware->handle(Object, 1, 1) (Line: 23)
Stack\StackedHttpKernel->handle(Object, 1, 1) (Line: 718)
Drupal\Core\DrupalKernel->handle(Object) (Line: 19)

Our ignore settings indeed contained such pattern:

cohesion_*
cohesion.*
~cohesion_sync.cohesion_sync_package.*

But this has been working for us for a long time, so I don't understand why this is:

  • A: Suddenly throwing this exception
  • B: The error is not gracefully handled
  • C: There is no validation constraint

Steps to reproduce

- On a version before update hook 8301
- Have config ignore settings like above
- Update module
- cr + updb + cex
- Fatal error

Proposed resolution

Not sure yet...

Remaining tasks

Provide pull request

API changes

🐛 Bug report
Status

Fixed

Version

3.0

Component

Code

Created by

🇧🇪Belgium BramDriesen Belgium 🇧🇪

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Merge Requests

Comments & Activities

Production build 0.69.0 2024