Bug #96589
open['sys_category']['ctrl']['sortby'] = ''; removes the sql entry for sorting
0%
Description
The following entry in /TCA/Overrides/sys_category.php in an extension:
$GLOBALS['TCA']['sys_category']['ctrl']['sortby'] ='';
removes the field sorting from the sql definitions of the table sys_category. This results in a message in the datebase analyzer:
ALTER TABLE `sys_category` CHANGE `sorting` `zzz_deleted_sorting` INT DEFAULT 0 NOT NULL
Of course if you do so, TYPO3 will crash because the sorting field is needed for all database operations with sys_category.
The problem occurs if you want to change the default sorting of sys_category e. g.:
$GLOBALS['TCA']['sys_category']['ctrl']['sortby'] = null;
$GLOBALS['TCA']['sys_category']['ctrl']['default_sortby'] = 'ORDER BY title';
default_sorty is only considered when sortby is empty (null or '')
The problem exists in TYPO3 10 and 11.
Updated by Georg Ringer over 2 years ago
thanks for creating the issue. What do you want to achieve?
Updated by Georg Ringer over 2 years ago
- Status changed from New to Needs Feedback
Updated by Peter Linzenkirchner over 2 years ago
I want to achieve sorting of categories alphabetically by title. default_sortby does this but only when sortby is empty. And when sortby is empty than the sql information is lost and the database analyser wants to delete the field sorting.