• Resolved gastronimo

    (@gastronimo)


    Hi Sami,

    I recently updated to the latest version, running on 4.9.6 and one subsite of my multisite gives me blank admin pages. The error log reads:

    [31-May-2018 01:52:41 UTC] PHP Fatal error: Uncaught Error: Call to a member function add_cap() on null in /home/pl/public_html/wp-content/plugins/custom-permalinks/custom-permalinks.php:118
    Stack trace:
    #0 /home/pl/public_html/wp-content/plugins/custom-permalinks/custom-permalinks.php(132): Custom_Permalinks::plugin_activate()
    #1 /home/pl/public_html/wp-includes/class-wp-hook.php(286): Custom_Permalinks->load_textdomain(”)
    #2 /home/pl/public_html/wp-includes/class-wp-hook.php(310): WP_Hook->apply_filters(NULL, Array)
    #3 /home/pl/public_html/wp-includes/plugin.php(453): WP_Hook->do_action(Array)
    #4 /home/pl/public_html/wp-settings.php(327): do_action(‘plugins_loaded’)
    #5 /home/pl/wp-config.php(137): require_once(‘/home/pl/…’)
    #6 /home/pl/public_html/wp-load.php(42): require_once(‘/home/pl/…’)
    #7 /home/pl/public_html/wp-blog-header.php(13): require_once(‘/home/pl/…’)
    #8 /home/pl/public_html/index.php(17): require(‘/home/pl/…’)
    #9 {main}
    thrown in /home/pl/public_html/wp-content/plugins/custom-permalinks/custom-permalinks.php on line 118

    I already deactivated custom theme to default to 2015, and removed the plugin View Admin As, in case that was conflicting, but no relief in sight. Unless and until I remove Custom Permalinks, then I get the admin pages back.

    Can you please suggest something ASAP?!

    Thank you.

Viewing 3 replies - 1 through 3 (of 3 total)
  • Hi @gastronimo,

    View Admin As doesn’t do anything related to this error.
    I did take a look at the code, could it be that your installation doesn’t have the administrator role?
    If so, I always recommend to not remove any WP default roles as some plugins etc. rely on these roles, especially the administrator role.

    What happens here is that the code tries to get the administrator role and add 2 capabilities to it. But since it can’t find that role it returns null and this results in an error.

    Let me know if this helps.

    Cheers, Jory
    Author plugin: View Admin As.

    Plugin Author Sami Ahmed Siddiqui

    (@sasiddiqui)

    @gastronimo Sorry to having this issue.

    @keraweb Thanks for pointing that scenario ??

    I have applied the condition over add_cap() so, it may not give you the Fatal Error anymore either you have administrator role or not.

    Please upgrade to the latest version and provide your feedback.

    Thanks,
    Sami

    Thread Starter gastronimo

    (@gastronimo)

    To confirm, I have upgraded to the most recent version of both, and yes I am SuperAdmin, and I no longer have the error, so THANK YOU. SUPER!

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘FATAL ERROR on update’ is closed to new replies.