Problem/Motivation

In the wake of #3405800: Config collections do not trigger configuration events consistently, we realized that the config events are all lumped into one class (\Drupal\Core\Config\ConfigEvents), which is a bit overloaded. In particular, these events:

  • \Drupal\Core\Config\ConfigEvents::IMPORT_VALIDATE
  • \Drupal\Core\Config\ConfigEvents::IMPORT
  • \Drupal\Core\Config\ConfigEvents::IMPORT_MISSING_CONTENT
  • \Drupal\Core\Config\ConfigEvents::STORAGE_TRANSFORM_IMPORT
  • \Drupal\Core\Config\ConfigEvents::STORAGE_TRANSFORM_EXPORT

All of these operate on complete storages, not on individual config objects, regardless of which collection they're in. They should probably be moved to their own class to make it clearer what they're for -- Drupal\Core\Config\ConfigImportEvents or ConfigStorageEvents. Name TBD.

Proposed resolution

Move the constants I just listed into a new class, and deprecate the old ones.

Remaining tasks

Well, just moving code around and adding some deprecation comments, really.

API changes

Yes, this will deprecate some existing event constants.

Release notes snippet

TBD but we'll likely need something here.

Issue fork drupal-3406348

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:

Comments

phenaproxima created an issue. See original summary.

wim leers’s picture

Title: Move config import-related events out of ConfigEvents and into their own class » Move config import/storage-related events out of ConfigEvents and into their own class
wim leers’s picture

Category: Feature request » Task
Issue tags: +DX (Developer Experience), +@deprecated
wim leers’s picture

Title: Move config import/storage-related events out of ConfigEvents and into their own class » Move config import-related events out of ConfigEvents, into a new ConfigImporterEvents
Assigned: Unassigned » wim leers

wim leers’s picture

Assigned: wim leers » Unassigned
Status: Active » Needs review

Ready for review :)

bircher’s picture

Status: Needs review » Reviewed & tested by the community

The export transformation event is not really about the importer. But it should be together with the import transformation event and that one is. So I think this makes sense.

alexpott’s picture

@bircher well you are transforming on export for import somewhere :)

quietone’s picture

Status: Reviewed & tested by the community » Needs work
Issue tags: +Needs change record updates

I'm triaging RTBC issues. I read the IS, the comments, the change record and the MR. I didn't find any unanswered questions. However, the change record does not match what the MR is doing.

I am setting to needs work for updating the change record.

Version: 11.x-dev » main

Drupal core is now using the main branch as the primary development branch. New developments and disruptive changes should now be targeted to the main branch.

Read more in the announcement.