Bug #87352

TCA "ctrl" "default_sortby" does not work with multiple fields due to new queryBuilder

Added by Daniel Dorndorf 6 months ago. Updated about 2 months ago.

Status:
Closed
Priority:
Should have
Assignee:
-
Category:
Backend API
Start date:
2019-01-07
Due date:
% Done:

100%

TYPO3 Version:
9
PHP Version:
7.2
Tags:
tca, default_sortby, querybuilder
Complexity:
Is Regression:
Sprint Focus:

Description

Having multiple fields defined for "default_sortby" in the ctrl TCA section doesn't work anymore.

in "typo3/sysext/recordlist/Classes/RecordList/DatabaseRecordList.php:3322" the array of the fields is iterated, but the new queryBuilder only supports the omitting of one orderby field.

This is leading to the last defined field is used for the actual order by.

Greetings
Daniel

Associated revisions

Revision 8d282936 (diff)
Added by Andreas Fernandez 6 months ago

[BUGFIX] Use `addOrderBy()` to support multiple orderings

`DatabaseRecordList::prepareQueryBuilder()` is able to handle multiple
order clauses defined in either `sortby` or `default_sortby`. However,
the wrong method for appending the order clause is used, which results in
overriding the previous set clause.

This patch changes the method to use `addOrderBy()` instead which appends
multiple order clauses properly.

Resolves: #87352
Releases: master, 9.5
Change-Id: I08f4248d4dc890079715efb9a48b1d270a6b1077
Reviewed-on: https://review.typo3.org/59356
Tested-by: TYPO3com <>
Reviewed-by: featdd <>
Tested-by: featdd <>
Reviewed-by: Wouter Wolters <>
Tested-by: Wouter Wolters <>
Reviewed-by: Georg Ringer <>
Tested-by: Georg Ringer <>

Revision ea879320 (diff)
Added by Andreas Fernandez 6 months ago

[BUGFIX] Use `addOrderBy()` to support multiple orderings

`DatabaseRecordList::prepareQueryBuilder()` is able to handle multiple
order clauses defined in either `sortby` or `default_sortby`. However,
the wrong method for appending the order clause is used, which results in
overriding the previous set clause.

This patch changes the method to use `addOrderBy()` instead which appends
multiple order clauses properly.

Resolves: #87352
Releases: master, 9.5
Change-Id: I08f4248d4dc890079715efb9a48b1d270a6b1077
Reviewed-on: https://review.typo3.org/59358
Tested-by: TYPO3com <>
Reviewed-by: Wouter Wolters <>
Tested-by: Wouter Wolters <>
Reviewed-by: Georg Ringer <>
Tested-by: Georg Ringer <>

History

#1 Updated by Andreas Fernandez 6 months ago

  • Status changed from New to In Progress

#2 Updated by Gerrit Code Review 6 months ago

  • Status changed from In Progress to Under Review

Patch set 1 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/59356

#3 Updated by Gerrit Code Review 6 months ago

Patch set 1 for branch 9.5 of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/59358

#4 Updated by Gerrit Code Review 6 months ago

Patch set 2 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/59356

#5 Updated by Gerrit Code Review 6 months ago

Patch set 2 for branch 9.5 of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/59358

#6 Updated by Andreas Fernandez 6 months ago

  • Status changed from Under Review to Resolved
  • % Done changed from 0 to 100

#7 Updated by Gerrit Code Review 6 months ago

  • Status changed from Resolved to Under Review

Patch set 3 for branch 9.5 of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/59358

#8 Updated by Andreas Fernandez 6 months ago

  • Status changed from Under Review to Resolved

#9 Updated by Benni Mack about 2 months ago

  • Status changed from Resolved to Closed

Also available in: Atom PDF