Support

Home Forums Event Espresso Premium PHP Fatal error: Uncaught TypeError: EE_Capabilities::map_meta_caps()

PHP Fatal error: Uncaught TypeError: EE_Capabilities::map_meta_caps()

Posted: October 9, 2023 at 3:16 am

Viewing 5 reply threads


UHHmarketing

October 9, 2023 at 3:16 am

We have noticed the PHP Fatal error triggered by the Event Espresso plugin.
Plugin Version: 5.0.10
Wordpress Version: 6.3.1
PHP Version: 8.1.24

mod_fcgid: stderr: PHP Fatal error: Uncaught TypeError: EE_Capabilities::map_meta_caps(): Argument #2 ($cap) must be of type string, null given, called in /httpdocs/wp-includes/class-wp-hook.php on line 310 and defined in /httpdocs/wp-content/plugins/event-espresso-core-reg/core/EE_Capabilities.core.php:317


Tony

  • Support Staff

October 9, 2023 at 3:23 am

Hi there,

Do you have the full stack trace?

Something is calling map_meta_cap on an empty string, as in no capability.

The error is from EE requiring a capability to be passed, but the cause is whatever is calling the above with no capability. That may well be EE itself or something else but the stacktrace will show what function called it to narrow this down.


UHHmarketing

October 20, 2023 at 12:54 am

Hi,

Thank you for your message. I’ve enabled wp_debug as you suggested to check for the full stack trace. I’ll follow up with the stack trace and share the information with you on Tuesday (10/24). This will help us narrow down the issue and identify what’s causing the map_meta_cap error.


Tony

  • Support Staff

October 20, 2023 at 2:06 am

Awesome, once we have the stacktrace we can see what is calling it and work from there.

Once suggestion (if you are not using it already) is to use this snippet:

https://eventespresso.com/wiki/troubleshooting-checklist/#wpdebug

That enabled WP_DEBUG but sets the site NOT to display errors but rather log them in /wp-content/debug.log


UHHmarketing

October 30, 2023 at 5:51 am

Here is the stacktrace captured in /wp-content/debug.log file:

[27-Oct-2023 11:16:46 UTC] PHP Fatal error: Uncaught TypeError: EE_Capabilities::map_meta_caps(): Argument #2 ($cap) must be of type string, null given, called in /httpdocs/wp-includes/class-wp-hook.php on line 310 and defined in /httpdocs/wp-content/plugins/event-espresso-core-reg/core/EE_Capabilities.core.php:317
Stack trace:
#0 /httpdocs/wp-includes/class-wp-hook.php(310): EE_Capabilities->map_meta_caps()
#1 /httpdocs/wp-includes/plugin.php(205): WP_Hook->apply_filters()
#2 /httpdocs/wp-includes/capabilities.php(842): apply_filters()
#3 /httpdocs/wp-includes/class-wp-user.php(777): map_meta_cap()
#4 /httpdocs/wp-includes/capabilities.php(985): WP_User->has_cap()
#5 /httpdocs/wp-includes/capabilities.php(877): user_can()
#6 /httpdocs/wp-content/plugins/kt-tinymce-color-grid/index.php(1113): current_user_can()
#7 /httpdocs/wp-includes/class-wp-hook.php(312): kt_Central_Palette->add_action_link()
#8 /httpdocs/wp-includes/plugin.php(205): WP_Hook->apply_filters()
#9 /httpdocs/wp-content/plugins/jetpack/jetpack_vendor/automattic/jetpack-sync/src/modules/class-callables.php(378): apply_filters()
#10 /httpdocs/wp-includes/class-wp-hook.php(310): Automattic\Jetpack\Sync\Modules\Callables->set_plugin_action_links()
#11 /httpdocs/wp-includes/class-wp-hook.php(334): WP_Hook->apply_filters()
#12 /httpdocs/wp-includes/plugin.php(517): WP_Hook->do_action()
#13 /httpdocs/wp-admin/includes/class-wp-screen.php(424): do_action()
#14 /httpdocs/wp-admin/includes/screen.php(243): WP_Screen->set_current_screen()
#15 /httpdocs/wp-content/plugins/jetpack/jetpack_vendor/automattic/jetpack-sync/src/class-sender.php(505): set_current_screen()
#16 /httpdocs/wp-content/plugins/jetpack/jetpack_vendor/automattic/jetpack-sync/src/class-sender.php(601): Automattic\Jetpack\Sync\Sender->get_items_to_send()
#17 /httpdocs/wp-content/plugins/jetpack/jetpack_vendor/automattic/jetpack-sync/src/class-sender.php(462): Automattic\Jetpack\Sync\Sender->do_sync_for_queue()
#18 /httpdocs/wp-content/plugins/jetpack/jetpack_vendor/automattic/jetpack-sync/src/class-sender.php(404): Automattic\Jetpack\Sync\Sender->do_sync_and_set_delays()
#19 /httpdocs/wp-content/plugins/jetpack/jetpack_vendor/automattic/jetpack-sync/src/class-actions.php(193): Automattic\Jetpack\Sync\Sender->do_dedicated_sync_and_exit()
#20 /httpdocs/wp-includes/class-wp-hook.php(310): Automattic\Jetpack\Sync\Actions::add_dedicated_sync_sender_init()
#21 /httpdocs/wp-includes/class-wp-hook.php(334): WP_Hook->apply_filters()
#22 /httpdocs/wp-includes/plugin.php(517): WP_Hook->do_action()
#23 /httpdocs/wp-settings.php(632): do_action()
#24 /httpdocs/wp-config.php(101): require_once(‘…’)
#25 /httpdocs/wp-load.php(50): require_once(‘…’)
#26 /httpdocs/wp-blog-header.php(13): require_once(‘…’)
#27 /httpdocs/index.php(17): require(‘…’)
#28 {main}
thrown in /httpdocs/wp-content/plugins/event-espresso-core-reg/core/EE_Capabilities.core.php on line 317


Tony

  • Support Staff

October 30, 2023 at 6:25 am

Thank you, that’s exactly what I needed.

So the error is from Central Color Palette calling current_user_can() with no capability. Its essentially saying ‘Does the current user have the ‘nothing’ capability to do X’ on some requests, EE requires a capability is passed when hooking into the above and throws an error.

We are going to relax the typing within EE in the next version to work around this and prevent the fatal from happening, its technically not an issue from Event Espresso but as we are setting the type we throw the fatal.

Viewing 5 reply threads

The support post ‘PHP Fatal error: Uncaught TypeError: EE_Capabilities::map_meta_caps()’ is closed to new replies.

Have a question about this support post? Create a new support post in our support forums and include a link to this existing support post so we can help you.

Event Espresso