Fix phpThumbOf with MODX 3

If like me since you updated to version 3 of MODX your pages using the Extra phpThumbOf are not loading anymore, do not panic, I have found a solution.

Why the problem?

MODX 3 seems to have moved some of its files since phpThumbOf was last updated. The consequence is that the Extra could no more load the library it needs.


You have to edit 2 files. One is accessible through the manager and the second have to be edited via FTP (or SSH if you have access to your server).

Via the manager

Edit the Elements > Snippets > phpthumbof in the manager.

You can delete or comment the following code:

if (!$modx->loadClass('modPhpThumb',$modx->getOption('core_path').'model/phpthumb/',true,true)) {
    $modx->log(modX::LOG_LEVEL_ERROR,'[phpThumbOf] Could not load modPhpThumb class.');
    return '';

This code is no more necessary, as modPhpThumb is now always included in MODX.


The file to edit via FTP is, <modx root>/core/components/phpthumbof/model/phpthumbof/phpthumbof.class.php.

In this file, replace line #193 by

$this->phpThumb = new MODX\Revolution\modPhpThumb($this->modx);

The end

And that is it!

Ce contenu a été publié dans MODX par geekc, et marqué avec . Mettez-le en favori avec son permalien.

Laisser un commentaire