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 commentedConfigImporter::notify()uses theConfigImporter::IDto 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::IMPORTandConfigEvents::VALIDATE.Comment #2
alexpottConfigImporter::IDwas 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 commentedThis patch also:
ConfigImporter::IDand replaces it withConfigImporter::LOCKIDfor 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 commentedChanges in this patch:
ConfigEvents::VALIDATErenamed toConfigEvents::IMPORT_VALIDATEConfigImporter::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_IDLets remove getLockId() too and just use ConfigImporter::LOCK_ID
Comment #10
sutharsan commentedComments in #9 implemented.
Comment #12
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 commentedRerolled #12 patch
Comment #16
gábor hojtsyBack to RTBC.
Comment #18
sutharsan commentedConfigImporterchanges applied to newDrupal\Core\Config\BatchConfigImporterthat 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!