Skip to content

Ticket Summary Report Fails Due to Reserved Keyword order in HD Ticket Status #3005

@iphenelist

Description

@iphenelist

The Ticket Summary report fails with a MariaDB syntax error when loading enabled statuses from the HD Ticket Status DocType.

The issue occurs because the report uses:

order_by="order asc"

If the DocType contains a field named order, MariaDB throws a syntax error since order is a reserved SQL keyword.


Error Trace

pymysql.err.ProgrammingError: (1064, 
"You have an error in your SQL syntax; check the manual that corresponds 
to your MariaDB server version for the right syntax to use near 
'order asc /* FRAPPE_TRACE_ID: ... */'")

Affected Code

File:
helpdesk/helpdesk/report/ticket_summary/ticket_summary.py

Expected Behavior

The report should load and sort statuses correctly without SQL errors.


Environment

frappe: 15.99.0  
helpdesk: 1.19.4  

Image

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