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.
When accessing to update.php page, I get a WSOD because hook_xautoload()
is not executed as early as possible.
To avoid this annoying behavior I added a hook_system_theme_info()
implementation as hook_custom_theme()
does to get all the classes loaded as early as possible.
Here is the patch attached.
Thank you for this great module.
Comment | File | Size | Author |
---|---|---|---|
update_page_xautoload.patch | 459 bytes | plopesc | |
Comments
Comment #1
donquixote CreditAttribution: donquixote commentedIs this due to an un-loadable class? Where is this class being used?
Can we have a reproducible case?
What's the stack trace for this hook, when called on update.php?
I just want to get a better idea what is going on, before I commit this.
Comment #2
pjcdawkins CreditAttribution: pjcdawkins commentedI had the same problem writing a hook_update_N() implementation. In the end, I added that enterMainPhase() directly in my update hook which solved it for me.
Comment #3
plopescHello donquixote, here is the backtrace from update.php:
To make this working, we already added this hook in plug module: https://github.com/Plug-Drupal/plug/blob/7.x-1.x/plug.module#L43
But would be great if you could add this to xautoload module.
Thank you
Comment #5
donquixote CreditAttribution: donquixote commentedNote: This problem only applies to namespaces registered with hook_xautoload().
The regular Drupal\MODULENAME\CLASS in MODULEDIR/src/CLASS.php is not affected.
Comment #6
donquixote CreditAttribution: donquixote commentedThanks for the patch, and sorry for the long wait!
Fix will be in 7.x-5.3.
Comment #7
donquixote CreditAttribution: donquixote commented