Updated to Modx 3, error 503

Updated to version Modx 3.
The site has a news section, examples of work, employees, etc.
Everything is displayed through Collection 4.0.0. Error 503 occurs when you go to the page of the full material. Pictures for the materials are displayed through the additional TV img field.

<img src="[[*img:phpthumbon=`w=540&h=480zc=1`]]" alt="[[*pagetitle]]">

If you disable the additional img field, then the page of the full material opens normally. If enabled then error 503

The problem is probably the extra phpThumbOn.

I installed it (version 1.3.1-pl) to test it and get an error too (“Call to a member function make() on null …”).
$this->modx->getService('fileHandler','modFileHandler'); doesn’t seem to work anymore in MODX3.


Maybe try using pThumb instead.
According to this site it should be compatible with MODX3.

Or you can rewrite code a bit of the phpthumbon extension.
All bellow changes are in the file core/components/phpthumbon/model/phpthumbon/phpthumbon.class.php

So for example this part

$this->modx->getService('fileHandler','modFileHandler');

Should become this

$fileHandler = $this->modx->getService('fileHandler', modFileHandler::class);

And then to create dir you can do it like that

$dirObj = $this->modx->fileHandler->make($dir, array(), modDirectory::class);

Also need to add this at the top fo the file

 use MODX\Revolution\File\modFileHandler;
 use MODX\Revolution\File\modDirectory;
 use MODX\Revolution\modPhpThumb;

Hope it will help someone