Bug #85142

Recent reordering of TCA select items processing makes it impossible to post-process foreign_table items

Added by Joschi Kuphal over 1 year ago. Updated 9 days ago.

Status:
Under Review
Priority:
Must have
Assignee:
-
Category:
FormEngine aka TCEforms
Start date:
2018-06-02
Due date:
% Done:

0%

TYPO3 Version:
9
PHP Version:
7.2
Tags:
Complexity:
Is Regression:
Yes
Sprint Focus:

Description

The recently introduced reordering of TCA select items processing (#75834) in typo3/sysext/backend/Classes/Form/FormDataProvider/TcaSelectItems.php has moved the itemsProcFunc-processing before the addition of items from a foreign_table, effectively breaking the only way to post-process these items (i.e. rename, change value, etc.).

An example would be the post-processors for static_info_tables entities which don't work any longer (https://docs.typo3.org/typo3cms/extensions/static_info_tables/Manual/Index.html#alternate-value-fields-for-entity-selector).


Related issues

Related to TYPO3 Core - Bug #75834: removeItems, backendLayouts, pageTSconfig Closed 2016-04-21
Related to TYPO3 Core - Bug #85622: itemsProcFunc in TCA -> select with foreign_table works not correctly New 2018-07-23
Related to TYPO3 Core - Bug #87569: itemsProcFunc in TCA in combination with used table not working correct New 2019-01-29

History

#1 Updated by Joschi Kuphal over 1 year ago

  • Related to Bug #75834: removeItems, backendLayouts, pageTSconfig added

#2 Updated by Benni Mack over 1 year ago

  • Target version changed from 9.3 to Candidate for patchlevel

#3 Updated by Gerrit Code Review over 1 year ago

  • Status changed from New 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/57185

#4 Updated by Stefan Froemken over 1 year ago

IMO that is not a bug of TYPO3.
Please have a look at the old TYPO3 versions:

https://github.com/TYPO3/TYPO3.CMS/blob/TYPO3_4-7/t3lib/class.t3lib_tceforms.php#L1423:L1435

Order was, and should be: Filter, Add, UserFunc, Remove.
That ordering has changed while FormEngine refactoring for which reason I have created your mentioned patch to repair that ordering again.

It's the job of an integrator to decide which values should be visible or not.

Stefan

#5 Updated by Joschi Kuphal over 1 year ago

Hi Stefan,

I'm not sure if I understand your comment correctly or if we are referring to the same thing (or if it was intended for me at all).

Order was, and should be: Filter, Add, UserFunc, Remove.

I'm totally with you here. However, if you look at the current code (https://github.com/TYPO3/TYPO3.CMS/blob/master/typo3/sysext/backend/Classes/Form/FormDataProvider/TcaSelectItems.php#L48:L80) — please correct me if I'm wrong — then the order is something like this:

  1. Sanitize (/ Filter?)
  2. UserFunc
  3. Wild mixture of Add and Remove

There is no way to use the itemsProcFunc (step 2) for walking over the records added from a foreign table (happening in step 3), while this has always been possible in earlier versions (https://github.com/TYPO3/TYPO3.CMS/blob/TYPO3_4-7/t3lib/class.t3lib_tceforms.php#L1417). Don't you agree?

#6 Updated by Stefan Froemken over 1 year ago

You're right. Forget my post. I have interpreted the code wrong.

#7 Updated by Gerrit Code Review about 1 year 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/57185

#8 Updated by Torben Hansen 8 months ago

  • Related to Bug #85622: itemsProcFunc in TCA -> select with foreign_table works not correctly added

#9 Updated by Torben Hansen 8 months ago

  • Related to Bug #87569: itemsProcFunc in TCA in combination with used table not working correct added

#10 Updated by Gerrit Code Review about 1 month ago

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

#11 Updated by Gerrit Code Review about 1 month ago

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

#12 Updated by Gerrit Code Review about 1 month ago

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

#13 Updated by Gerrit Code Review about 1 month ago

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

#14 Updated by Gerrit Code Review about 1 month ago

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

#15 Updated by Gerrit Code Review about 1 month ago

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

#16 Updated by Gerrit Code Review about 1 month ago

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

#17 Updated by Gerrit Code Review about 1 month 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/c/Packages/TYPO3.CMS/+/61939

#18 Updated by Gerrit Code Review about 1 month ago

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

Also available in: Atom PDF