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
Steps to reproduce:
Install standard profile
Export config
Reinstall minimal
Hack site uuid (drush cset system.site uuid 'whatever the uuid from the original install was')
Run import
Exceptions will be thrown during route rebuilding, during HttpKernel:terminate()
Issues like #2325185: Convert views_element_info() to Element classes throw further exceptions, which are actually caught by the testbot.
This doesn't happen during module uninstall, since ModuleHandler::uninstall() calls \Drupal::service('plugin.cache_clearer')->clearCachedDefinitions()
directly.
Proposed resolution
Remaining tasks
User interface changes
API changes
Comment | File | Size | Author |
---|---|---|---|
#19 | dfac-2326409-19-interdiff.txt | 431 bytes | Berdir |
#19 | dfac-2326409-19.patch | 11.94 KB | Berdir |
Comments
Comment #1
tim.plunkettUnfortunately this doesn't actually resolve the issue. The code continues to run, and hits a different exception. Let's see if that shows up on tests.
Comment #2
sunNeed to study some more, but in any case, upfront:
Touching the order of operations in
dfac()
isn't the solution.dfac()
is designed for same-state cache flushing + application rebuilding.The operations in
dfac()
are performed in exactly the order that is required for its intended use-case. Installation requires a different order. Uninstallation requires the reverse order of Installation (simplified).Due to that, changing the order of operations in
dfac()
may seemingly resolve the problem of the calling code, but will cause failures elsewhere. Most likely, the root cause is thatuninstall()
callsdfac()
in the first place.Comment #4
tim.plunkettThe bug I'm seeing isn't related to ModuleHandler::uninstall(), but ConfigImporter::flush().
Regardless of all that, this at least is a correct change.
Comment #5
moshe weitzman CreditAttribution: moshe weitzman commentedThat code comment was not at all related to its code. Good fix. Shall we wait for a more complete fix or proceed with the current patch?
Comment #6
tim.plunkettThis is *a* fix, but it doesn't actually fix the bug I had in mind when I opened this issue. It's certainly not critical on its own...
Not sure what to do.
Comment #7
dawehnerDid anyone considered throwing an event when clearing these caches?
Comment #8
tim.plunkettOkay, let's not pin this on dfac.
Comment #9
moshe weitzman CreditAttribution: moshe weitzman commentedOK, lets just go ahead with the patch as is, for now.
Comment #10
tim.plunkettWell, this issue is already referred to by several others, and blocks ALL of the hook_element_info conversions (except system).
So I spun out #2327965: drupal_flush_all_caches() doesn't clear all plugin caches to get the quick fix in.
Comment #11
xjmComment #12
xjmTo clarify #10, per @tim.plunkett, #2327965: drupal_flush_all_caches() doesn't clear all plugin caches does not by itself unblock the
hook_element_info()
conversions.Comment #13
dawehnerAfaik #2313135: setting page_cache_without_database in settings.php prevents the container from being dumped could allows us to get rid of some of those problems.
Comment #15
BerdirPatch #1 is green now, setting back to needs review.
Comment #16
tim.plunkettThat got moved to #2327965: drupal_flush_all_caches() doesn't clear all plugin caches
Comment #17
BerdirSo @timplunkett said that his patch in here didn't fix the issue for him originally. Removed all the the hook_element_info() and enable @RenderElement, let's see what happens exactly.
Comment #19
BerdirThat went wrong.
Comment #22
almaudoh CreditAttribution: almaudoh commentedWow!! Will this also unblock #2028109: Convert hook_stream_wrappers() to tagged services.? I'll try a patch over there...
Comment #23
BerdirGreen!
Comment #24
tim.plunkettWas it really just #2313135: setting page_cache_without_database in settings.php prevents the container from being dumped?! I'm so glad this passes now.
Comment #25
alexpottRetitling to say what the issue is actually doing.
Committed 3b2e57f and pushed to 8.0.x. Thanks!