5.92: Setting DEFAULT SORT ORDER in AG and an order in _init fails
Posted: 2021-01-07 13:42
Hi,
I have set a default sort order in AG.
When I set an additional sort order in the _init function (hooks/tablename.php -> ) the page is not displayed at, but I get an error thrown.
AG Setting: Code in _init:
SQL in the error shown, when I open the page (I am marking the wrong SQL - so unfortunately I can not use the code-tag) - there is an extra desc added. I would think if I define an extra $options->DefaultSortField the AG application would/should ignore the settings from AG:
-----------------------
SELECT
... all my fields...
FROM
... my table/joins ...
ORDER BY
JobFertiggestellt DESC,
Log_Fertig_Zeit DESC,
BenoetigtAm,
ID_Container_Platz_aktuell DESC
desc
LIMIT 0, 50
-----------------------
I am not sure if this also happens when I do not set descending as sortorder in AG.
Olaf
I have set a default sort order in AG.
When I set an additional sort order in the _init function (hooks/tablename.php -> ) the page is not displayed at, but I get an error thrown.
AG Setting: Code in _init:
Code: Select all
$options->DefaultSortField = 'JobFertiggestellt DESC, Log_Fertig_Zeit DESC, BenoetigtAm ASC, ID_Container_Platz_aktuell DESC';
-----------------------
SELECT
... all my fields...
FROM
... my table/joins ...
ORDER BY
JobFertiggestellt DESC,
Log_Fertig_Zeit DESC,
BenoetigtAm,
ID_Container_Platz_aktuell DESC
desc
LIMIT 0, 50
-----------------------
I am not sure if this also happens when I do not set descending as sortorder in AG.
Olaf