Git-updater: Object of class Fragen\GitHub_Updater\Base could not be converted

Created on 20 Sep 2017  ·  18Comments  ·  Source: afragen/git-updater

Hi,

Getting this after the latest update of WordPress (auto updated last night) and the GitHub Updater new update:

Catchable fatal error: Object of class Fragen\GitHub_Updater\Base could not be converted to string in /wp-content/plugins/wp-super-cache/wp-cache-base.php on line 23

Thanks

bug fixed

Most helpful comment

I fixed this issue in https://github.com/afragen/github-updater/commit/fdccd98b84eb1c6bb19f03f31fcb0da4ba0ad7bf

What was happening was I was inadvertently overwriting some generic global variables. In this case $base. 🤦‍♂️

All 18 comments

This is an error in wp-super-cache. I’ll take a look.

I cannot replicate this error in my local development environment.

I got the error on two websites, both hosted in different locations. Would it help if I provided any setup details?

I've had to disable the plugin for the time being.

Thanks

Setup details might help. You might also try a different caching plugin.

If I can replicate it I’m happy to try and solve the issue.

Can you reproduce this in a local development environment?

Updated the plugin on a local development site, which doesn't have the caching plugin activated and now I get a 500 error on all admin pages.

Very odd. The setup of my local development is just a mac with mysql installed.

Very strange as 500 errors are usually Apache or nginx related. I use a Mac too. Just in case you haven’t done this already you might try restarting you computer. There’s really no reason that GHU would cause a 500 error by itself.

I’m not sure what to tell you from here. ¯_(ツ)_/¯

I am getting this as well with wp-super-cache and the latest github updater

Appears to affect only multisite? The sites I'm having issues with are all multisite.
Steps to reproduce:
Fresh install of Wordpress (I'm using the default docker wordpress container with the default mariadb container)
Install and activate Github Updater (latest:7.3.1)
Install and activate WP-Super-Cache (latest:1.5.5)

Everything works...

Edit wp-config.php > add the line:
define( 'WP_ALLOW_MULTISITE', true );

admin pages now show:
Catchable fatal error: Object of class Fragen\GitHub_Updater\Base could not be converted to string in /var/www/html/wp-content/plugins/wp-super-cache/wp-cache-base.php on line 23

Roll back to earlier Github Updater (I only had 7.1.0 on hand)
Everything works again.

Thanks for looking!

So I installed an network activated WP-Super-Cache on my local dev multisite install. It's running WP 4.8.2, my develop branch of GitHub Updater, and WP-Super-Cache 1.5.5.

I testing using both Apache and nginx on PHP 7.1.4, PHP 5.6.20, PHP 5.3.29. I went all over the network admin and site admin. What I found was eventually I got a 500 error with Apache regardless of the PHP version. In looking through my Apache logs I saw the following error.

[core:alert] [pid 1383:tid 140125002503936] [client 172.17.0.1:33140] /app/public/.htaccess: RewriteRule: bad flag delimiters, referer: http://multisite.test/
````
The following was my default `.htaccess` file. This may have been from my local dev environment.
```conf
# BEGIN WordPress
RewriteEngine On
RewriteBase /
RewriteRule ^index.php$ - [L]

# add a trailing slash to /wp-admin
RewriteRule ^wp-admin$ wp-admin/ [R=301,L]

RewriteCond %{REQUEST_FILENAME} -f [OR]
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^ - [L]
RewriteRule ^(wp-(content|admin|includes).*) # BEGIN WordPress [L]
RewriteRule ^(.*.php)$ # BEGIN WordPress [L]
RewriteRule . index.php [L]
# END WordPress

Running this through http://www.htaccesscheck.com/index.html
It seems that Apache doesn't like inline comments.

Changing .htaccess to the following and everything works.

# BEGIN WordPress
RewriteEngine On
RewriteBase /
RewriteRule ^index.php$ - [L]

# add a trailing slash to /wp-admin
RewriteRule ^wp-admin$ wp-admin/ [R=301,L]

RewriteCond %{REQUEST_FILENAME} -f [OR]
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^ - [L]
RewriteRule ^(wp-(content|admin|includes).*) [L]
RewriteRule ^(.*.php)$ [L]
RewriteRule . index.php [L]
# END WordPress

and all 500 error are gone.

Thus far I have not seen the initial error as described by the OP.

There didn't seem to be any issues with nginx. FYI, I’m using Local by Flywheel.

@fatjester it sounds like you’re creating a single site, activating the plugins, and then trying to update to a multisite. Is that correct?

I cannot reproduce this error after installing and activating the plugins in an existing multisite.

I am having the problems in existing multi sites, - the steps were just to
reproduce, but I’ll try again with an existing multi site first.

Just activating the wp-cache plugin alone won’t cause it, you’ll also need
to enable caching (noticing I left that out of my steps).

Thanks

On Tue, Sep 26, 2017 at 9:50 AM Andy Fragen notifications@github.com
wrote:

@fatjester https://github.com/fatjester it sounds like you’re creating
a single site, activating the plugins, and then trying to update to a
multisite. Is that correct?

I cannot reproduce this error after installing and activating the plugins
in an existing multisite.


You are receiving this because you were mentioned.

Reply to this email directly, view it on GitHub
https://github.com/afragen/github-updater/issues/603#issuecomment-332243569,
or mute the thread
https://github.com/notifications/unsubscribe-auth/ABNQ9RAkUlvxxIMpBuciQQHPtTKQMYBzks5smR1agaJpZM4PdemM
.

I did have caching enabled. I did not use anything other than the default wp-super-cache options. Still never saw the error.

I tried again to replicate this in ways that break, and don't break.

On a Fresh wordpress install converted to sub-domain multisite with latest Github Updater and Wp-Super-Cache network activated works

On a Fresh wordpress install converted to sub-folder multisite with latest Github Updater and Wp-Super-Cache network activated breaks

Steps to recreate Error

  1. Create fresh installation of Wordpress using Docker Default Wordpress and MariaDB containers
  2. Convert to sub-folder multisite
  3. Install and Network Activate Github Updater
  4. Install and Network Activate Wp-Super-Cache
  5. Throws error: Catchable fatal error: Object of class Fragen\GitHub_Updater\Base could not be converted to string in /var/www/html/wp-content/plugins/wp-super-cache/wp-cache-base.php on line 23

Downgrading to Github Updater Version 7.1.0 restores Wordpress to a working state.

I hope that helps.

Thanks. I’ll test this as soon as I can.

I haven't seen my initial error since, just get the 500 error which you describe. So I'll try that updated htaccess file.

My setup is also a multi-site with sub-folders.

Thanks for your help.

@Flecket that htaccess is for subdomains. You should find clean htaccess settings in on the Network Settings areas.

I fixed this issue in https://github.com/afragen/github-updater/commit/fdccd98b84eb1c6bb19f03f31fcb0da4ba0ad7bf

What was happening was I was inadvertently overwriting some generic global variables. In this case $base. 🤦‍♂️

Was this page helpful?
0 / 5 - 0 ratings

Related issues

jasonjersey picture jasonjersey  ·  3Comments

uturnr picture uturnr  ·  14Comments

tdavidrussell picture tdavidrussell  ·  4Comments

pnoeric picture pnoeric  ·  9Comments

andruwa13 picture andruwa13  ·  3Comments