[BUGFIX] Sorting not respected for backend layout dropdowns 12/20712/2
authorAnja Leichsenring <aleichsenring@ab-softlab.de>
Sun, 12 May 2013 07:02:02 +0000 (09:02 +0200)
committerAnja Leichsenring <aleichsenring@ab-softlab.de>
Sun, 12 May 2013 07:15:33 +0000 (09:15 +0200)
The core record backend_layout can be sorted manually, but this is not
reflected in the pages TCA for the dropdowns backend_layout and
backend_layout_next_level.

This patch fixes this issue by adding the sorting in the foreign_where
clause

Thanks to Frans Saris for reporting this issue

Change-Id: I04680278075ddc0de69600423be5fe783e34f562
Resolves: #47688
Releases: 4.5, 4.7, 6.0, 6.1, 6.2
Reviewed-on: https://review.typo3.org/20712
Reviewed-by: Anja Leichsenring
Tested-by: Anja Leichsenring
t3lib/stddb/tbl_pages.php

index e1bd3fd..27e6416 100644 (file)
@@ -712,7 +712,7 @@ $TCA['pages'] = array(
                        'config' => array(
                                'type' => 'select',
                                'foreign_table' => 'backend_layout',
-                               'foreign_table_where' => 'AND ( ( ###PAGE_TSCONFIG_ID### = 0 AND ###STORAGE_PID### = 0 ) OR ( backend_layout.pid = ###PAGE_TSCONFIG_ID### OR backend_layout.pid = ###STORAGE_PID### ) OR ( ###PAGE_TSCONFIG_ID### = 0 AND backend_layout.pid = ###THIS_UID### ) ) AND backend_layout.hidden = 0',
+                               'foreign_table_where' => 'AND ( ( ###PAGE_TSCONFIG_ID### = 0 AND ###STORAGE_PID### = 0 ) OR ( backend_layout.pid = ###PAGE_TSCONFIG_ID### OR backend_layout.pid = ###STORAGE_PID### ) OR ( ###PAGE_TSCONFIG_ID### = 0 AND backend_layout.pid = ###THIS_UID### ) ) AND backend_layout.hidden = 0  ORDER BY backend_layout.sorting',
                                'items' => array(
                                        array('', 0),
                                        array('LLL:EXT:cms/locallang_tca.xml:pages.backend_layout.none', -1)
@@ -729,7 +729,7 @@ $TCA['pages'] = array(
                        'config' => array(
                                'type' => 'select',
                                'foreign_table' => 'backend_layout',
-                               'foreign_table_where' => 'AND ( ( ###PAGE_TSCONFIG_ID### = 0 AND ###STORAGE_PID### = 0 ) OR ( backend_layout.pid = ###PAGE_TSCONFIG_ID### OR backend_layout.pid = ###STORAGE_PID### ) OR ( ###PAGE_TSCONFIG_ID### = 0 AND backend_layout.pid = ###THIS_UID### ) ) AND backend_layout.hidden = 0',
+                               'foreign_table_where' => 'AND ( ( ###PAGE_TSCONFIG_ID### = 0 AND ###STORAGE_PID### = 0 ) OR ( backend_layout.pid = ###PAGE_TSCONFIG_ID### OR backend_layout.pid = ###STORAGE_PID### ) OR ( ###PAGE_TSCONFIG_ID### = 0 AND backend_layout.pid = ###THIS_UID### ) ) AND backend_layout.hidden = 0 ORDER BY backend_layout.sorting',
                                'items' => array(
                                        array('', 0),
                                        array('LLL:EXT:cms/locallang_tca.xml:pages.backend_layout.none', -1)