Problem with uncacher when upgrading to 2.8.7

Summary

After doing a point upgrade from 2.8.6 to 2.8.7, some pages are coming up blank and the errorlog is reporting a problem with uncacher.

Step to reproduce

Using the UpgradeModX Extra, complete the upgrade 2.8.6 to 2.8.7.
Attempt to view an article. If necessary make a small edit.
Check the error log

Observed behavior

After saving a page edit and then viewing it, the article page comes up blank. The error returned is

ERROR @ /path/to/core/components/uncacher/model/uncacher/uncacher.class.php : 61) PHP warning: file_get_contents(http://url/of/page): failed to open stream: HTTP request failed! HTTP/1.0 500 Internal Server Error

Expected behavior

The page should render

Environment

Mod x version: 2.8.7-pl
DB mysql Ver 15.1 Distrib 10.11.9-MariaDB, for Linux (x86_64) using readline 5.1

I’m not sure Uncacher is really the issue here.
Rather there seems to be an issue with the page that is requested ( → http://url/of/page). What happens when you request this page directly?

Also try to locate the PHP error log file on your system and check what gets added when the “500 Internal Server Error” occurs. (Usually 500 errors are not logged in the MODX error log file.)

I think you might be right because when you check the error log, you get

PHP Parse error: syntax error, unexpected ':', expecting ';' or '{' in /path/to/core/model/phpthumb/phpthumb.class.php on line 317

So my guess is that it’s something to do with PHP versions.

The function in question was

public function __set(string $name, $value) : void {
}

I just changed it to:

public function __set(string $name, $value) {
}

and everything worked.

According to the docs, the minimum PHP version for 2.8.x is 5.6.x and evidently someone updated the phpthumbclass with some PHP 7 code without regression testing it.

How can this be logged as a bug?

You created this thread with the same issue some months ago.

In that thread, I told you that you have to create a pull request on Github, if you want it fixed for PHP 5.6.


For what it’s worth, this is the response I got when pointing out, that my fix doesn’t support PHP versions < 7.1:

We have no intention of maintaining support for a PHP version that ended both active and security support over five years ago.

I don’t disagree with the principle they’ve laid out - it’s true you cannot support elderly environments forever.

However - when you (not YOU personally, modx’s creators) publish in the support docs, that you support a certain version of PHP, then … y’know, you actually have to follow through and support it…

Or you announce that as of version 2.whatever, PHP v5.x is no longer supported. That way, people know not to attempt an upgrade and stay on an older version of modx.