SOLVED::Problem persists with Gallery 2.0.0 not displaying images in Manager

Continuing the discussion from SOLVED::Error 42000 executing statement:

Images are not displayed in the Manager using Gallery 2.0.0 and Modx 2.8.4. I can upload new images and they display on the front end but in the Manager the content simply reads “No files match the specified filter.”

I can’t find in the files where to make any changes to ‘rank’ if this is indeed the issue.
The error I’m getting is:

[2022-07-12 11:49:45] (ERROR in modManagerRequest::prepareResponse @ /home/website/public_html/core/model/modx/modmanagerrequest.class.php : 187) modAction support is deprecated since version 2.3.0. Support for modAction has been replaced with routing based on a namespace and action name. Please update the extra with the namespace gallery to the routing based system.
[2022-07-12 11:49:46] (ERROR @ /home/website/public_html/core/xpdo/om/xpdoobject.class.php : 241) SQL: SELECT `galItem`.`id`, `galItem`.`name`, `galItem`.`filename`, `galItem`.`description`, `galItem`.`mediatype`, `galItem`.`url`, `galItem`.`createdon`, `galItem`.`createdby`, `galItem`.`active`, `galItem`.`duration`, `galItem`.`streamer`, `galItem`.`watermark_pos`, AlbumItems.rank, AS album, (
                SELECT GROUP_CONCAT(Tags.tag) FROM `modx_gallery_tags` AS Tags
                WHERE Tags.item =
            ) AS tags FROM `modx_gallery_items` AS `galItem` JOIN `modx_gallery_album_items` `AlbumItems` ON  ( = AlbumItems.item AND `AlbumItems`.`album` = ? )  JOIN `modx_gallery_albums` `Album` ON = AlbumItems.album LEFT JOIN `modx_gallery_tags` `Tags` ON `galItem`.`id` =  `Tags`.`item` GROUP BY id, rank ORDER BY rank ASC LIMIT 20 

Any help appreciated.

For this specific error the problem is likely in these 2 lines


But there are a many other places in the code (lines like $c->sortby('rank','ASC');) where “rank” is used and may create an SQL error in MySQL 8.

Thanks for the quick response.
Yes, I have found the word ‘rank’ in numerous files but what should I change this to and will changes need to be made to every entry?
Do i need to add the extra backticks?

Yes. In the lines above replace $c->groupBy('rank'); with $c->groupBy('`rank`'); and public $defaultSortField = 'rank'; with public $defaultSortField = '`rank`';

The problem with this Gallery extra is, that “rank” is used a lot and the backticks shouldn’t be added to all the occurrences in the code.

For example in this code ->get('rank') has to remain as it is and backticks need to be added to the other occurrences .

The simplest fix is probably to change the name of the column in the database tables and then replace all the occurences of “rank” in the code with the new name.

This topic was automatically closed 2 days after discussion ended and a solution was marked. New replies are no longer allowed. You can open a new topic by clicking the link icon below the original post or solution and selecting “+ New Topic”.