Project

General

Profile

Actions

Bug #96589

closed

['sys_category']['ctrl']['sortby'] = ''; removes the sql entry for sorting

Added by Peter Linzenkirchner almost 3 years ago. Updated 6 months ago.

Status:
Closed
Priority:
Should have
Assignee:
-
Category:
-
Target version:
-
Start date:
2022-01-19
Due date:
% Done:

0%

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

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.

Actions #1

Updated by Georg Ringer almost 3 years ago

thanks for creating the issue. What do you want to achieve?

Actions #2

Updated by Georg Ringer almost 3 years ago

  • Status changed from New to Needs Feedback
Actions #3

Updated by Peter Linzenkirchner almost 3 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.

Actions #4

Updated by Georg Ringer 6 months ago

  • Status changed from Needs Feedback to Closed

I am closing this issue as it is quite old and no change is expected

there are various changes possible like using `foreign_table_where` or building a custom query

Actions

Also available in: Atom PDF