• Hi,

    I am experiencing a similar issue to the recent
    https://www.ads-software.com/support/topic/fatal-error-with-has_cap-even-if-the-plugin-is-not-activated/ ticket but I thought I would explain the issue in my own way. I get a fatal error:

    Fatal error: Uncaught Error: Call to a member function has_cap() on null in /…/wp-content/plugins/breadcrumb-navxt/includes/class.mtekk_adminkit.php on line 73

    Directly after logging in. The front end and login page load fine but all admin pages are unavailable because of the fatal error. Here are some details of the site set up:

    – WordPress network install
    – I am logged in as a super admin
    – running WordPress 5.4.2
    – running Breadcrumb NavXT 6.5.0

    We have other sites in our network install that also use Breadcrumb NavXT. We can access the admin of those sites fine. Here is what is unique about the theme of the site that produces the fatal error mentioned above:

    – administrator role has been removed
    – there is various functionality that checks for the capabilities of the logged in user

    We did not experience this issue with Breadcrumb NavXT 6.4.0

    Thanks for your help ??

    • This topic was modified 4 years, 9 months ago by Steve Puddick.
Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author John Havlik

    (@mtekk)

    A change was made in 6.5 to use a custom capability for the settings page rather than the built-in manage_options. To ensue a seamless transition for most users, the administrator role is automatically given this permission. However, if you don’t have an administrator role (which is very different from a user named administrator), you are going to have problems. It appears that adminKit doesn’t check that it has a instance of WP_Role, so that will change for the next release (6.5.1). That said, if you don’t have an administrator role, you will need to give one of the roles the bcn_manage_options capability, otherwise you will not be able to edit the settings. Is there a reason that you’ve removed the administrator role?

    Thread Starter Steve Puddick

    (@stevepuddick)

    Thanks John. The theme that is experiencing this issue is highly dependent on custom user roles with custom capabilities. All the core WordPress roles were stripped out since they were not needed (including the administrator role). The site using this theme is on a network install and the theme is for private use. The duties that the ‘Administrator’ would typically do is done by the Super Admin users of the network install. Maybe an adjustment can be made to the code to see if the user has the bcn_manage_options capability OR is a Super Admin?

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Fatal Error on all admin pages in 6.5.0’ is closed to new replies.