Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Network activate fails on IndieBlocks error #21

Closed
janboddez opened this issue Jul 22, 2024 · 4 comments
Closed

Network activate fails on IndieBlocks error #21

janboddez opened this issue Jul 22, 2024 · 4 comments

Comments

@janboddez
Copy link
Owner

PHP Fatal error:  Uncaught Error: Call to undefined function IndieBlocks\get_options() in wp-content/plugins/indieblocks/includes/webmention/class-webmention.php:98
Stack trace:
#0 wp-content/plugins/indieblocks/includes/webmention/class-webmention-sender.php(14): IndieBlocks\Webmention\Webmention::get_supported_post_types()
#1 wp-content/plugins/indieblocks/includes/webmention/class-webmention.php(20): IndieBlocks\Webmention\Webmention_Sender::register()
#2 wp-includes/class-wp-hook.php(324): IndieBlocks\Webmention\Webmention::register()
#3 wp-includes/class-wp-hook.php(348): WP_Hook->apply_filters()
#4 wp-includes/plugin.php(517): WP_Hook->do_action()

🤷

@janboddez
Copy link
Owner Author

I think IndieBlocks uses the Composer autoloader, so something would be calling this (static) class without loading IndieBlocks' functions.php or something.

@janboddez
Copy link
Owner Author

Still don't understand, but it looks like this might (?) be fixed by removing functions.php from

    "autoload": {
        "classmap": ["includes/", "blocks/"],
        "files": ["includes/functions.php"]
    }

and instead including it explicitly.

Or move away from

add_action( 'init', array( __CLASS__, 'init' ) );

in IndieBlocks' Webmention class.

I dunno. Looks like something is triggering autoloading of the Webmention class without the plugin being fully loaded.

@janboddez
Copy link
Owner Author

janboddez commented Jul 23, 2024

Possibly related: humbug/php-scoper#1036

Looks like it affects only autoloaded files (and not classmaps). So functions.php and, possibly, the mf2 library.

Moving functions.php out of the autoloaded files and requiring it explicitly, for now. May have to do the same with php-mf2. Or "manually" fix the autoload_files.php and autoload_static.php files?

@janboddez
Copy link
Owner Author

Fixed by manually adjusting files' hashes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant