Gallery with mysql8.0

After reading threads like

and

I can not solve the problem.
First I changed the lines 31 and 66 in getlist.class.php to rank with backlinks but no solution.
Than I changed the name of the columns at gallery_album and gallery_album_items to galRank
I changed at least 9 files I found with rank in /core/components/gallery/processors/mgr/item and /album
following files I changed rank to galRank
item/getlistclass.php #31 #66 #58
item/ajaxupload.class.php #93
item/ajaxupload.php #99
item/batchupload.class.php #127
item/upload.class.php #84
album/creat.class.php #43
album/getnodes.class.php #34
album/sort.class.php #58 #40
also I changed many ranks in
item/sort.class.php
here is my actual code:

class GalleryItemSortProcessor extends modProcessor {

public function process(){
    $modx = $this->modx;
    $scriptProperties = $this->properties;

    $source = $modx->getObject('galAlbumItem',array(
        'album' => $scriptProperties['album'],
        'item' => $scriptProperties['source'],
    ));
    if (empty($source)) return $modx->error->failure();

    $target = $modx->getObject('galAlbumItem',array(
        'album' => $scriptProperties['album'],
        'item' => $scriptProperties['target'],
    ));
    if (empty($target)) return $modx->error->failure();

    if ($source->get('rank') < $target->get('rank')) {
        $modx->exec("
            UPDATE {$modx->getTableName('galAlbumItem')}
                SET galRank = galRank - 1
            WHERE
                album = ".$scriptProperties['album']."
            AND galRank < {$target->get('rank')}
            AND galRank > {$source->get('rank')}
            AND galRank > 0
        ");
        $newRank = $target->get('rank')-1;
    } else {
        $modx->exec("
            UPDATE {$modx->getTableName('galAlbumItem')}
                SET galRank = galRank + 1
            WHERE
                album = ".$scriptProperties['album']."
            AND galRank >= {$target->get('rank')}
            AND galRank < {$source->get('rank')}
        ");
        $newRank = $target->get('rank');
    }
    $source->set('galRank',$newRank);
    $source->save();

    return $modx->error->success();
}

}
return ‘GalleryItemSortProcessor’;

But still no gallery pictures in manager or frontend.
When I open a gallery, to look if the images are there, than the album is without album name.

Is there any more rank which has to change or do I have changed one to much?

Take a look at this pull request to see where “rank” has to be changed:

Thank you for that link.
Now I found the right files and could do the changes.
But still no pictures in Manager.
I deinstalled gallery, delete the gallery-tables from database. Make a new installation of gallery. Do the changes in the files again.
→ No pictures in manager.
Make a new album, put pictures in, but even with testpage, no gallery-pictures in frontend.

There must be anything else wrong. But what is the problem?

Curiosity:
I have an other Modx, at an other server. The same configuration PHP8.0 and Mysql8.0.2 but no problems with gallery and I never done the changes in the 8 files.

Are there any related error messages somewhere? In the MODX error log, the server error log, the console of the browser’s developer tools?


Do images of a normal Image TV get displayed correctly? Maybe it’s a problem with phpThumb instead.

Normal Image TV are not displayed. (I dont use them in this site)

Error log in Modx after making new gallery and put some pictures in:

Blockquote
[2023-03-13 12:23:15] (ERROR @ /var/www/vhosts/web103.my_server/httpdocs/my_domain/core/cache/includes/elements/modx/revolution/modplugin/4.include.cache.php : 21) PHP warning: Undefined array key “file”
[2023-03-13 12:23:15] (ERROR @ /var/www/vhosts/web103.my_server/httpdocs/my_domain/core/cache/includes/elements/modx/revolution/modplugin/4.include.cache.php : 24) PHP warning: Trying to access array offset on value of type null
[2023-03-13 12:23:15] (ERROR @ /var/www/vhosts/web103.my_server/httpdocs/my_domain/core/cache/includes/elements/modx/revolution/modplugin/4.include.cache.php : 28) PHP warning: Trying to access array offset on value of type null
[2023-03-13 12:23:16] (ERROR @ /var/www/vhosts/web103.my_server/httpdocs/my_domain/core/vendor/james-heinrich/phpthumb/phpthumb.class.php : 1376) PHP warning: is_readable(): open_basedir restriction in effect. File(/assets/gallery/2/7.jpg) is not within the allowed path(s): (/var/www/vhosts/web103.my_server/:/tmp/)
[2023-03-13 12:23:16] (ERROR @ /var/www/vhosts/web103.my_server/httpdocs/my_domain/core/components/gallery/processors/web/phpthumb.class.php : 150) PHP warning: chmod(): No such file or directory
[2023-03-13 12:23:29] (ERROR @ /var/www/vhosts/web103.my_server/httpdocs/my_domain/core/cache/includes/elements/modx/revolution/modplugin/4.include.cache.php : 21) PHP warning: Undefined array key “file”
[2023-03-13 12:23:29] (ERROR @ /var/www/vhosts/web103.my_server/httpdocs/my_domain/core/cache/includes/elements/modx/revolution/modplugin/4.include.cache.php : 24) PHP warning: Trying to access array offset on value of type null
[2023-03-13 12:23:29] (ERROR @ /var/www/vhosts/web103.my_server/httpdocs/my_domain/core/cache/includes/elements/modx/revolution/modplugin/4.include.cache.php : 28) PHP warning: Trying to access array offset on value of type null
[2023-03-13 12:23:29] (ERROR @ /var/www/vhosts/web103.my_server/httpdocs/my_domain/core/cache/includes/elements/modx/revolution/modplugin/4.include.cache.php : 21) PHP warning: Undefined array key “file”
[2023-03-13 12:23:29] (ERROR @ /var/www/vhosts/web103.my_server/httpdocs/my_domain/core/cache/includes/elements/modx/revolution/modplugin/4.include.cache.php : 24) PHP warning: Trying to access array offset on value of type null
[2023-03-13 12:23:29] (ERROR @ /var/www/vhosts/web103.my_server/httpdocs/my_domain/core/cache/includes/elements/modx/revolution/modplugin/4.include.cache.php : 28) PHP warning: Trying to access array offset on value of type null
[2023-03-13 12:23:30] (ERROR @ /var/www/vhosts/web103.my_server/httpdocs/my_domain/core/vendor/james-heinrich/phpthumb/phpthumb.class.php : 1376) PHP warning: is_readable(): open_basedir restriction in effect. File(/assets/gallery/2/8.jpg) is not within the allowed path(s): (/var/www/vhosts/web103.my_server/:/tmp/)
[2023-03-13 12:23:30] (ERROR @ /var/www/vhosts/web103.my_server/httpdocs/my_domain/core/components/gallery/processors/web/phpthumb.class.php : 150) PHP warning: chmod(): No such file or directory
[2023-03-13 12:23:30] (ERROR @ /var/www/vhosts/web103.my_server/httpdocs/my_domain/core/vendor/james-heinrich/phpthumb/phpthumb.class.php : 1376) PHP warning: is_readable(): open_basedir restriction in effect. File(/assets/gallery/2/9.jpg) is not within the allowed path(s): (/var/www/vhosts/web103.my_server/:/tmp/)
[2023-03-13 12:23:30] (ERROR @ /var/www/vhosts/web103.my_server/httpdocs/my_domain/core/components/gallery/processors/web/phpthumb.class.php : 150) PHP warning: chmod(): No such file or directory

If I just upload a singel picture, there will be displayed just a white frame.
If I us multi-upload, I get frames with transparent background and an image-placeholder on the top left.

Sorry there was a mistake in my image-tv. Now it is displayed.
But the error told about phpthumg.class.php

Maybe try changing the system value phpthumb_allow_src_above_docroot (like in this topic).

When changing phpthumb_allow_src_above_docroot to yes and than clearing cache in modx I get folloeing warning:

Could not load class: modPhpThumb from modphpthumb
[phpThumbOf] Could not load modPhpThumb class in plugin.

And no changing in gallery, still are no thumb pictures displayed.

I still try to solve the problem.
Now I deleted all old galleries in the database. Than completly new install of gallery. At the installation I get the commend “mkdir already exists”.
When I make a new album and fill in some pictures I get following error in the modx system

[2023-03-21 21:13:18] (ERROR @ /var/www/vhosts/my_server/httpdocs/my_domain/core/vendor/james-heinrich/phpthumb/phpthumb.class.php : 1376) PHP warning: is_readable(): open_basedir restriction in effect. File(/assets/gallery/3/16.jpg) is not within the allowed path(s): (/var/www/vhosts/my_server/:/tmp/)
[2023-03-21 21:13:18] (ERROR @ /var/www/vhosts/my_server/httpdocs/my_domain/core/components/gallery/processors/web/phpthumb.class.php : 150) PHP warning: chmod(): No such file or directory
[2023-03-21 21:13:26] (ERROR @ /var/www/vhosts/my_server/httpdocs/my_domain/core/cache/includes/elements/modx/revolution/modplugin/4.include.cache.php : 21) PHP warning: Undefined array key “file”
[2023-03-21 21:13:26] (ERROR @ /var/www/vhosts/my_server/httpdocs/my_domain/core/cache/includes/elements/modx/revolution/modplugin/4.include.cache.php : 24) PHP warning: Trying to access array offset on value of type null
[2023-03-21 21:13:26] (ERROR @ /var/www/vhosts/my_server/httpdocs/my_domain/core/cache/includes/elements/modx/revolution/modplugin/4.include.cache.php : 28) PHP warning: Trying to access array offset on value of type null
[2023-03-21 21:13:27] (ERROR @ /var/www/vhosts/my_server/httpdocs/my_domain/core/vendor/james-heinrich/phpthumb/phpthumb.class.php : 1376) PHP warning: is_readable(): open_basedir restriction in effect. File(/assets/gallery/3/19.jpg) is not within the allowed path(s): (/var/www/vhosts/my_server/:/tmp/)
[2023-03-21 21:13:27] (ERROR @ /var/www/vhosts/my_server/httpdocs/my_domain/core/components/gallery/processors/web/phpthumb.class.php : 150) PHP warning: chmod(): No such file or directory

At the server I get following error:

AH01071: Got error ‘PHP message: PHP Fatal error: Uncaught Error: Undefined constant “IMAGETYPE_AVIF” in /var/www/vhosts/my_server/httpdocs/my_domain/core/vendor/james-heinrich/phpthumb/phpthumb.class.php:3770\nStack trace:\n#0 /var/www/vhosts/my_server/httpdocs/my_domain/core/vendor/james-heinrich/phpthumb/phpthumb.class.php(3912): phpthumb->ImageCreateFromFilename()\n#1 /var/www/vhosts/my_server/httpdocs/my_domain/core/vendor/james-heinrich/phpthumb/phpthumb.class.php(419): phpthumb->SourceImageToGD()\n#2 /var/www/vhosts/my_server/httpdocs/my_domain/core/components/gallery/processors/web/phpthumb.class.php(174): phpthumb->GenerateThumbnail()\n#3 /var/www/vhosts/my_server/httpdocs/my_domain/core/src/Revolution/Processors/Processor.php(189): GalleryPhpthumbProcessor->process()\n#4 /var/www/vhosts/my_server/httpdocs/my_domain/core/src/Revolution/modX.php(1820)…’, referer: https://www.my_domain.eu/manager/?a=album/update&namespace=gallery&album=3

I hope anybody can help me. I have three different modx-cms on three different servers. At two installations I have no problems with gallery, (also one is still modx2.7). Only this installation makes trouble.
At the same server I made a new modx3.0.2 installation. Here I can see the thumbs and pictures in the manager. I cannot test, cause I get the same problem I had in the live installation and I posted here #6485

Thank you for help.