• Resolved Kevin Vess

    (@kevinvess)


    Hello, great plugin!

    There seems to be a fatal error occurring throughout the WordPress admin panel for the Author user role on our site:

    Fatal error: Uncaught TypeError: Tribe\Events\Admin\Settings::admin_footer_text_settings(): Return value must be of type string, null returned in /nas/content/live/public/wp-content/plugins/the-events-calendar/src/Tribe/Admin/Settings.php:458 Stack trace: #0 /nas/content/live/public/wp-content/plugins/the-events-calendar/common/vendor/lucatume/di52/src/tad/DI52/closuresSupport.php(31): Tribe\Events\Admin\Settings->admin_footer_text_settings(NULL) #1 /nas/content/live/public/wp-includes/class-wp-hook.php(308): {closure}(NULL) #2 /nas/content/live/public/wp-includes/plugin.php(205): WP_Hook->apply_filters(NULL, Array) #3 /nas/content/live/public/wp-content/plugins/the-events-calendar/common/src/Tribe/Credits.php(88): apply_filters(‘tec_admin_foote…’, NULL) #4 /nas/content/live/public/wp-includes/class-wp-hook.php(308): Tribe__Credits->rating_nudge(NULL) #5 /nas/content/live/public/wp-includes/plugin.php(205): WP_Hook->apply_filters(NULL, Array) #6 /nas/content/live/public/wp-admin/admin-footer.php(48): apply_filters(‘admin_footer_te…’, ‘<span id=”foote…’) #7 /nas/content/live/public/wp-admin/tools.php(99): require_once(‘/nas/content/li…’) #8 {main} thrown in /nas/content/live/public/wp-content/plugins/the-events-calendar/src/Tribe/Admin/Settings.php on line 458

    Any help with this issue would be greatly appreciated.

    Thanks!
    Kevin

Viewing 10 replies - 1 through 10 (of 10 total)
  • Thread Starter Kevin Vess

    (@kevinvess)

    Upon further investigation, it appears this fatal error is happening to all user roles below Administrator.

    Thread Starter Kevin Vess

    (@kevinvess)

    It appears the issue is the following method requires the returned value to be a string:

    public function admin_footer_text_settings( $footer_text ): string {

    If I remove the type declaration and change that line to this instead, it stops throwing the fatal error and the admin pages work properly:

    public function admin_footer_text_settings( $footer_text ) {

    Hopefully you can apply this fix quickly to the next release.

    Thanks!
    Kevin

    Plugin Support Chika Ibeneme

    (@chikaibeneme)

    Hi @kevinvess

    Thank you so much for that information. I have a couple of questions below that would help me to verify and log this for our team.

    – Does this only happen when that specific role is signed in? or after they sign in and create an event? Can you let me know the specific steps to reproduce this, please?

    – What version of The Events calendar are you using, along with your WP and PHP version, please?

    Thread Starter Kevin Vess

    (@kevinvess)

    We’re using WordPress 6.1.1, Version 6.0.13.1 of The Events Calendar plugin, and PHP 8.0.

    This fatal error is happening on every page of the admin panel, but we first noticed it while an Author was trying to access the Medial Library.

    I believe the issue is that non-Administrators using the admin panel experience different footer text. Although your method requiring the footer text value to be a string works for an admin, it doesn’t work for non-Admins when the footer text is NULL.

    So, the simplest solution to me is to not require that value to be a string and allow NULL/empty values to be returned.

    Thanks,
    Kevin

    • This reply was modified 1 year, 6 months ago by Kevin Vess. Reason: Added PHP version to details
    Plugin Support Chika Ibeneme

    (@chikaibeneme)

    Hi Kevin,

    Thank you so much for that information.

    I will spend some time trying to replicate this and checking with our dev team to see if we can get this replicated. Will post an update as soon as I can.

    Plugin Support Darian

    (@d0153)

    Hi @kevinvess

    Could you try activating only our plugins and us a basic theme like 2020 theme, and see if the issue persists? After that, you can re-activate your plugins/theme one at a time and check which one is causing the issue.

    See- Testing Conflicts With Themes and Other Plugins

    I suggest conducting these tests on a Staging Server. If you haven’t created one yet, you can use the WP Staging plugin.

    Let me know how it goes.

    Thread Starter Kevin Vess

    (@kevinvess)

    @d0153

    I can try testing for a conflict, but don’t you think you should adjust the plugin code to handle a scenario where the admin_footer_text_settings() method might be sent a NULL value and it doesn’t result in a fatal error?

    Plugin Support Darian

    (@d0153)

    Hi @kevinvess

    Thanks for your message.

    Let me share this with the team and I’ll get back to you once I know more.

    Also, I tried replicating the issue, but it’s working on my side using an account with “Author” permission. I accessed every admin page available, including the Media Library, and it’s working as expected on my end.

    Were you able to try a conflict test on your end? As always, please test it on a staging site.

    Looking forward to your reply.

    Plugin Support Darian

    (@d0153)

    Hi @kevinvess

    I hope all is going well for you. I noticed it’s been a while since we last heard from you. Have you had a chance to give the recommendation we previously suggested a try?

    Plugin Support Darian

    (@d0153)

    Hi @kevinvess

    It seems like it has been some time since we received a response from you, therefore, I will consider this matter as resolved. If you require any further assistance, please do not hesitate to start a new thread.

Viewing 10 replies - 1 through 10 (of 10 total)
  • The topic ‘Fatal Error with Author User Role’ is closed to new replies.