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

Satispress breaks when updating plugins with incorrect version number format #115

Closed
koengabriels opened this issue Dec 2, 2019 · 3 comments

Comments

@koengabriels
Copy link

When trying to update the plugins made available through Satispress we encountered the following error messsage:

#0 /sites/plugins.appsaloon.be/files/wp-includes/class-wp-hook.php(286): SatisPress\Provider\Capabilities->map_meta_cap(Array, NULL, 0, Array)
#1 /sites/plugins.appsaloon.be/files/wp-includes/plugin.php(208): WP_Hook->apply_filters(Array, Array)
#2 /sites/plugins.appsaloon.be/files/wp-includes/capabilities.php(614): apply_filters('map_meta_cap', Array, NULL, 0, Array)
#3 /sites/plugins.appsaloon.be/files/wp-includes/class-wp-user.php(740): map_meta_cap(NULL, 0)
#4 /sites/plugins.appsaloon.be/files/wp-includes/capabilities.php(649): WP_User->has_cap(NULL)
#5 /sites/plugins.appsaloon.be/files/wp-includes/post.php(3509): current_user_can(NULL)
#6 /sites/plugins.appsaloon. in /sites/plugins.appsaloon.be/files/wp-content/plugins/satispress-0.5.0/src/Provider/Capabilities.php on line 41
[13-Nov-2019 16:06:07 UTC] PHP Notice:  Trying to get property 'cap' of non-object in /sites/plugins.appsaloon.be/files/wp-includes/post.php on line 3509
[13-Nov-2019 16:06:07 UTC] PHP Notice:  Trying to get property 'publish_posts' of non-object in /sites/plugins.appsaloon.be/files/wp-includes/post.php on line 3509
[13-Nov-2019 16:06:07 UTC] PHP Fatal error:  Uncaught TypeError: Argument 2 passed to SatisPress\Provider\Capabilities::map_meta_cap() must be of the type string, null given, called in /sites/plugins.appsaloon.be/files/wp-includes/class-wp-hook.php on line 286 and defined in /sites/plugins.appsaloon.be/files/wp-content/plugins/satispress-0.5.0/src/Provider/Capabilities.php:41

As it turns out some plugins had an incorrect version number format.
Would be great if Satispress ignored these plugins instead of breaking, we had to manually figure out which plugins were causing issues and remove them.

@bradyvercher
Copy link
Member

I'm not quite sure what's going on here. Based on that error message, current_user_can() is being called with NULL as an argument somewhere. Do you know where that's happening or how an invalid version number is causing that?

@koengabriels
Copy link
Author

Tbh I have no idea where that null is coming from.
If I am able to free up some time I will try to do some debugging on this issue.

@bradyvercher
Copy link
Member

@koengabriels I shared a snippet in this comment that might be useful for accounting for plugins with non-standard version formats.

Feel free to reopen this issue with more information if you ever discover the cause of that error.

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

2 participants