Project

General

Profile

Actions

Bug #20425

closed

ctrl-section option 'sortby' => 'myfield DESC', causes SQL-error on saving a new record

Added by Jochen Rieger over 15 years ago. Updated about 6 years ago.

Status:
Closed
Priority:
Should have
Category:
-
Target version:
-
Start date:
2009-05-15
Due date:
% Done:

0%

Estimated time:
TYPO3 Version:
4.2
PHP Version:
5.2
Tags:
Complexity:
Is Regression:
Sprint Focus:

Description

I created a table via extMgr and changed the sortby option in ext_tables.php to

'sortby' => 'mysortfield DESC'

On saving the INSERT will look like this:

INSERT INTO tx_myable (field1, field2, mysortfield DESC, field3) VALUES ...

Of cause DESC will lead to an SQL error here.

(issue imported from #M11090)

Actions #1

Updated by Christian Kuhn over 15 years ago

Resolved, no change required:

According to the documentation [1] the sortby field must only contain a fieldname. Use the default_sortby field if you want explicit ASC / DESC sorting. Documentation quote:

"default_sortby" => "ORDER BY title",
"default_sortby" => "ORDER BY tstamp DESC",
"default_sortby" => "ORDER BY parent,crdate DESC",

The em will also produce such a config.

[1] http://typo3.org/documentation/document-library/core-documentation/doc_core_api/4.2.0/view/4/2/

Actions #2

Updated by Benni Mack about 6 years ago

  • Status changed from Resolved to Closed
Actions

Also available in: Atom PDF