Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Problem/Motivation
#2175917: Clean up configuration system events Cleaned event constants for ConfigEvents::VALIDATE
and ConfigEvents::IMPORT
, but the event dispatchers were not converted.
Proposed resolution
Use ConfigEvents::*
explicitly instead of building the event string in ConfigImporter::notify()
.
Remaining tasks
t.b.d.
User interface changes
none
API changes
The method ConfigImporter::getId()
is removed.
The method ConfigImporter::notify()
is removed - but it is protected so this is not an API change.
Comment | File | Size | Author |
---|---|---|---|
#18 | config-import-events-2195417-18.patch | 8.08 KB | Sutharsan |
#18 | interdiff-2195417-15-18.patch | 1.37 KB | Sutharsan |
#15 | config-import-events-2195417-15.patch | 6.84 KB | Sutharsan |
#12 | interdiff-2195417-10-12.txt | 935 bytes | Sutharsan |
#12 | config-import-events-2195417-12.patch | 6.62 KB | Sutharsan |
Comments
Comment #1
Sutharsan CreditAttribution: Sutharsan commentedConfigImporter::notify()
uses theConfigImporter::ID
to construct the event id string. I found that this ID was introduced in #1890784: Refactor configuration import and sync functions, but is now only used inConfigImporter
. This patch removes the usage of ID for events, and instead usedConfigEvents::IMPORT
andConfigEvents::VALIDATE
.Comment #2
alexpottConfigImporter::ID
was used to disambiguate installation and importing when they both used the ConfigImporter. This no longer occurs so lets clean that up here too.Comment #3
Sutharsan CreditAttribution: Sutharsan commentedThis patch also:
ConfigImporter::ID
and replaces it withConfigImporter::LOCKID
for use with lock.ConfigImporter::getId()
as it is no longer required.Comment #5
alexpott@beejeebus pointed out that VALIDATE could be confused with the CRUD events. Let's also rename this to IMPORT_VALIDATE
Comment #7
Gábor HojtsyYeah naming the events even better +1 :) Thanks Sutharsan for working on this :)
Comment #8
Sutharsan CreditAttribution: Sutharsan commentedChanges in this patch:
ConfigEvents::VALIDATE
renamed toConfigEvents::IMPORT_VALIDATE
ConfigImporter::getId()
is renamed toConfigImporter::getLockId()
. I removed getId in the previous patch, but the ID it was used to test the lock. Renamed the method to explains the meaning of the ID better.Comment #9
alexpottConvention is an underscore between words in class constants. So
LOCK_ID
Lets remove getLockId() too and just use ConfigImporter::LOCK_ID
Comment #10
Sutharsan CreditAttribution: Sutharsan commentedComments in #9 implemented.
Comment #12
Sutharsan CreditAttribution: Sutharsan commentedFixed a silly oversight.
Comment #13
Gábor HojtsyLooks good.
Comment #14
alexpottconfig-import-events-2195417-12.patch no longer applies.
Comment #15
Sutharsan CreditAttribution: Sutharsan commentedRerolled #12 patch
Comment #16
Gábor HojtsyBack to RTBC.
Comment #18
Sutharsan CreditAttribution: Sutharsan commentedConfigImporter
changes applied to newDrupal\Core\Config\BatchConfigImporter
that was added in #2004370: Batch the configuration synchronisation process.Comment #21
tim.plunkettCrossposting #1889474: Create tests for config event handling, that's an old major that I think is obsolete?
Comment #22
Gábor Hojtsy@tim.plunkett: thanks, closed that down as duplicate of #2175917: Clean up configuration system events where tests were added :)
Comment #23
Gábor HojtsyThis cleanup looks good :)
Comment #24
alexpottCommitted 65899f6 and pushed to 8.x. Thanks!