Skip to content

Fred still having issues with the usage of "rank" to sort elements with MySQL8 #521

@JANogueira

Description

@JANogueira

Hi all,

Recently I moved to a new hosting provider that is using MySQL8, and when trying to list the elements and blueprints on frontend, it returns an empty list.
When further debugging the issue, after printing the SQL query generated by the file:
/core/components/fred/src/Traits/Endpoint/Ajax/GetElements.php

It was visible that the rank field for sorting was being rejected by MySQL8 as it is a reserved keyword.

This file (and multiple others) uses the value defined on the fred settings for the setting element_group_sort.
When changing Fred settings that are set as rank to `rank`, all works fine.

Several files already contain the fix where backquotes were already added, but some other files still do not have rank with backquotes, breaking some parts of the frontend editing.

My environment:

  • Modx Revo 2.8.8
  • Fred 3.1.6
  • MySQL 8.0.36
  • Apache 2.4.62
  • PHP 8.5

Thanks

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions