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.

CommentFileSizeAuthor
update_page_xautoload.patch459 bytesplopesc
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

donquixote’s picture

When accessing to update.php page, I get a WSOD because hook_xautoload() is not executed as early as possible.

Is this due to an un-loadable class? Where is this class being used?
Can we have a reproducible case?

+ * Implements hook_system_theme_info().
+ *
+ * We only do this because that's the first hook to fire in update.php page.
+ */

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.

pjcdawkins’s picture

I 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.

plopesc’s picture

Hello donquixote, here is the backtrace from update.php:

Array
(
    [0] => Array
        (
            [file] => /home/plopesc/projects/tamc/www/modules/system/system.module
            [line] => 2502
            [function] => module_invoke_all
            [args] => Array
                (
                    [0] => system_theme_info
                )

        )

    [1] => Array
        (
            [file] => /home/plopesc/projects/tamc/www/includes/theme.inc
            [line] => 798
            [function] => _system_rebuild_theme_data
            [args] => Array
                (
                )

        )

    [2] => Array
        (
            [file] => /home/plopesc/projects/tamc/www/includes/theme.maintenance.inc
            [line] => 57
            [function] => list_themes
            [args] => Array
                (
                )

        )

    [3] => Array
        (
            [file] => /home/plopesc/projects/tamc/www/includes/bootstrap.inc
            [line] => 2609
            [function] => _drupal_maintenance_theme
            [args] => Array
                (
                )

        )

    [4] => Array
        (
            [file] => /home/plopesc/projects/tamc/www/update.php
            [line] => 444
            [function] => drupal_maintenance_theme
            [args] => Array
                (
                )

        )

)

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

  • donquixote committed 5eca2da on 7.x-5.x authored by plopesc
    Issue #2415733 by plopesc, donquixote: XAutoload fails to load classes...
donquixote’s picture

Note: This problem only applies to namespaces registered with hook_xautoload().
The regular Drupal\MODULENAME\CLASS in MODULEDIR/src/CLASS.php is not affected.

donquixote’s picture

Thanks for the patch, and sorry for the long wait!
Fix will be in 7.x-5.3.

donquixote’s picture

Status: Needs review » Fixed

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.