akirk / enable-mastodon-apps

Allow accessing your WordPress blog with Mastodon clients
https://wordpress.org/plugins/enable-mastodon-apps
GNU General Public License v2.0
34 stars 6 forks source link

Uncaught TypeError #142

Closed lostfocus closed 1 month ago

lostfocus commented 1 month ago

I'm getting this error when trying the plugin:

PHP Fatal error:  Uncaught TypeError: call_user_func_array(): Argument #1 ($callback) must be a valid callback, non-static method Activitypub\\Integration\\Enable_Mastodon_Apps::api_get_posts_query_args() cannot be called statically in /var/www/wordpress/wp-includes/class-wp-hook.php:326
Stack trace:
#0 /var/www/wordpress/wp-includes/plugin.php(205): WP_Hook->apply_filters()
#1 /var/www/wordpress/wp-content/plugins/enable-mastodon-apps/includes/handler/class-handler.php(50): apply_filters()
#2 /var/www/wordpress/wp-content/plugins/enable-mastodon-apps/includes/handler/class-status.php(200): Enable_Mastodon_Apps\\Handler\\Handler->get_posts_query_args()
#3 /var/www/wordpress/wp-includes/class-wp-hook.php(324): Enable_Mastodon_Apps\\Handler\\Status->mastodon_api_account_statuses_args()
#4 /var/www/wordpress/wp-includes/plugin.php(205): WP_Hook->apply_filters()
#5 /var/www/wordpress/wp-content/plugins/enable-mastodon-apps/includes/class-mastodon-api.php(2400): apply_filters()
#6 /var/www/wordpress/wp-includes/rest-api/class-wp-rest-server.php(1230): Enable_Mastodon_Apps\\Mastodon_API->api_account_statuses()
#7 /var/www/wordpress/wp-includes/rest-api/class-wp-rest-server.php(1063): WP_REST_Server->respond_to_request()
#8 /var/www/wordpress/wp-includes/rest-api/class-wp-rest-server.php(439): WP_REST_Server->dispatch()
#9 /var/www/wordpress/wp-includes/rest-api.php(428): WP_REST_Server->serve_request()
#10 /var/www/wordpress/wp-includes/class-wp-hook.php(324): rest_api_loaded()
#11 /var/www/wordpress/wp-includes/class-wp-hook.php(348): WP_Hook->apply_filters()
#12 /var/www/wordpress/wp-includes/plugin.php(565): WP_Hook->do_action()
#13 /var/www/wordpress/wp-includes/class-wp.php(418): do_action_ref_array()
#14 /var/www/wordpress/wp-includes/class-wp.php(813): WP->parse_request()
#15 /var/www/wordpress/wp-includes/functions.php(1336): WP->main()
#16 /var/www/wordpress/wp-blog-header.php(16): wp()
#17 /var/www/wordpress/index.php(17): require('...')
#18 {main}
  thrown in /var/www/wordpress/wp-includes/class-wp-hook.php on line 326

It's WP 6.5.3 on PHP 8.3

akirk commented 1 month ago

Oh, I'm sorry for this. Is your ActivityPub plugin up to date? In the current version that function should be "static".

pfefferle commented 1 month ago

I am not sure if we released that version yet 😱

I will prepare a release ASAP!

lostfocus commented 1 month ago

Ah, I'm also sorry - I didn't look closely enough to see that the message comes from the ActivityPub plugin. 🤦‍♂️ I'll close the ticket and wait for the new release of that plugin.

Thanks guys! I'm looking forward to using my blog that way!

akirk commented 1 month ago

Oh! If you're comfortable with editing code you could change the line public function api_get_posts_query_args to public static function api_get_posts_query_args in /var/www/wordpress/wp-content/plugins/activitypub/integrations/enable-mastodon-apps.php which should fix it.

akirk commented 1 month ago

@lostfocus No need to apologize. The 0.9.0 release tightens the relationship between the three plugins EMA, ActivityPub, and Friends. It shows that we need to try a bit harder to reveal which plugin causes which error message!

akirk commented 1 month ago

@pfefferle just released ActivityPub 2.4.0 (thank you!) This should fix it.

lostfocus commented 1 month ago

It works beautifully! Thanks a lot you two!