Local Community

Help! Fatal Error after enabling live link in 6.1.4 Beta 5520

After live link wouldn’t work in the normal Local, I downloaded the Beta version and imported my site. But when I tried to access the live link from my phone, everything crashed. It was a Fatal Error message with a big chart but I didn’t catch the screenshot before it changed. Now when I try to access my site, whether from Local or Local Beta, I get this message:

( ! ) Fatal error: Uncaught TypeError: Cannot access offset of type string on string in C:\Users\stomp\Local Beta Sites\asheville-baptist-institute\app\public\wp-includes\class-wp-roles.php on line 290

This is the section in the php file:

/**

 * Initializes all of the available roles.
 *
 * @since 4.9.0
 */
public function init_roles() {
    if ( empty( $this->roles ) ) {
        return;
    }
    $this->role_objects = array();
    $this->role_names   = array();
    foreach ( array_keys( $this->roles ) as $role ) {

Line 290:* $this->role_objects[ $role ] = new WP_Role( $role, $this->roles[ $role ][‘capabilities’] );

        $this->role_names[ $role ]   = $this->roles[ $role ]['name'];
    }

Local Log attached
local-lightning.log (129.4 KB)

Any suggestions highly appreciated!!

I tried it, but the mu-plugins folder is showing as empty?

Do you have a stack trace for this error?

Please excuse my previous reply. That’s a different issue.

What is a stack trace?

If you set define( WP_DEBUG, true ); in the wp-config.php file, when the error happens you will see a stack trace of the error.

Essentially it’s the sequence of calls leading to the error.

Thanks. Actually, I’d seen the mu-plugins fix in another thread and couldn’t find the file. After you commented here, I tried again (same folder) and suddenly it was there. I added your code, and the site worked. Then I enabled the live link again, and the site crashed again, and the mu-plugin file disappeared again. I still can’t see it (or the site). But this time I got a screenshot - is it the call stack you asked for?

That stack trace actually points back to the link I referenced.

I think every time you disable/enable live links the original file that needs the fix is installed. So the error recurs even though you fixed it once.

The file has changed a bit and the new fix is adding the following to line 155 in replace_host()

if ( is_object( $subject ) ) {
    return;
}

I was unable to find the mu-plugins php file, the folder was empty :-/ I’m back up and running though - I exported* my site and then reinstalled Local (after completely deleting all of its files) and imported the site. Had trouble importing it because it’d get stuck on “starting site services” but solved this by first adding two new sites (to fix hosts permission issue) and then imported my site without a hitch.

*Note: I’d exported my site prior to crashing it with the live-link, so I’m not sure this “fix” would work if exporting site afterwards

This topic was automatically closed 36 hours after the last reply. New replies are no longer allowed.