Ticket #2192 (new defect)

Opened 12 months ago

Last modified 8 weeks ago

Allow "DESC" ordering on CommentTableField

Reported by: mariocesar Owned by: aoneil
Priority: critical Milestone: 2.4.0
Component: CMS - General Version:
Severity: medium effort / impact Keywords: CommentTableField notformerge
Cc: Hours:

Description

Using the SVN 48175 rev, the admin/comments get a Fatal Error

FATAL ERROR: DATABASE ERROR: Couldn't run query: SELECT `PageComment`.*,
`PageComment`.ID, if(`PageComment`.ClassName,`PageComment`.ClassName,
'PageComment') AS RecordClassName FROM `PageComment` WHERE (Created DESC)
ORDER BY Created DESC | You have an error in your SQL syntax; check the
manual that corresponds to your MySQL server version for the right syntax
to use near 'DESC) ORDER BY Created DESC' at line 1
At line 431 in /var/www/sczlearn/sapphire/core/model/Database.php

The declared WHERE (Created DESC) appears to be a Syntax SQL Error. The SQL Query is already sorting the Created field.

Attachments

CommentTableField.php.diff (0.8 kB) - added by mariocesar 12 months ago.
Patch to solve FATAL ERROR Sql Syntax on cms/code/CommentTableField.php

Change History

Changed 12 months ago by mariocesar

Patch to solve FATAL ERROR Sql Syntax on cms/code/CommentTableField.php

Changed 11 months ago by sminnee

  • keywords CommentTableField notformerge added; CommentTableField, comments, admin removed

It looks like the underlying issue here is that ComplexTableField? can't have "DESC" in the default sort column.

Can we fix that bug instead? :-)

Changed 8 weeks ago by sminnee

  • summary changed from CommentTableField provoques a Fatal Error on SQL Syntax to Allow "DESC" ordering on CommentTableField
  • milestone changed from 2.3.0-rc1* to 2.4.0

Simple patch applied in r65783; better solution will be left until 2.4.

Note: See TracTickets for help on using tickets.