Project

General

Profile

Actions

Bug #102847

closed

Broken "itemsProcFunc" in 12.4.10

Added by Daniel Dorndorf 10 months ago. Updated about 1 month ago.

Status:
Closed
Priority:
Should have
Assignee:
-
Category:
FormEngine aka TCEforms
Target version:
Start date:
2024-01-17
Due date:
% Done:

100%

Estimated time:
TYPO3 Version:
12
PHP Version:
8.2
Tags:
Complexity:
Is Regression:
Yes
Sprint Focus:

Description

The latest update broke the "itemsProcFunc" on a select field with a site identifier.

Before the selected identifier could be fetched from the parameters array "$parameters['row']['site']", now it's gone and a NullSite is in $parameters['site'].
I don't know if this is a bug or breaking change.

Related GitHub Issue


Files

v12.4.9_output.jpg (21.3 KB) v12.4.9_output.jpg Debug output on version 12.4.9 Daniel Dorndorf, 2024-08-28 06:34
v12.4.19_output.jpg (18.3 KB) v12.4.19_output.jpg Debug output on version 12.4.19 Daniel Dorndorf, 2024-08-28 06:34

Related issues 1 (0 open1 closed)

Related to TYPO3 Core - Bug #102698: High load & response time after change itemsProcFunc in BackendUtility label functionsClosed2023-12-19

Actions
Actions #1

Updated by Georg Ringer 10 months ago

  • Status changed from New to Accepted
  • Is Regression set to Yes
Actions #2

Updated by David Bruchmann 9 months ago ยท Edited

Just from my current project:

## There is a bug, that it doesn't work on level
##    TCEFORM.[tableName].[fieldName].types.[typeName].itemsProcFunc
## therefore this level is used:
##    TCEFORM.[tableName].[fieldName].itemsProcFunc

Actually it's quite easy to apply it with

TCEFORM.tt_content.layout.itemsProcFunc < TCEFORM.tt_content.layout.types
TCEFORM.tt_content.layout.types >

Actions #3

Updated by Garvin Hicking 4 months ago

  • Category set to FormEngine aka TCEforms
  • Status changed from Accepted to Needs Feedback

Could you maybe give an example of what kind of itemsProcFunc you utilize and how/where you're processing the items and what is the expected result?

First guess would be that the 'site' is a bit more leaning towards frontend instantiation rather than backend, so it might very well be either a regression or conceptual choice, and I'm trying to get the picture :)

Actions #4

Updated by Daniel Dorndorf 4 months ago

Garvin Hicking wrote in #note-3:

Could you maybe give an example of what kind of itemsProcFunc you utilize and how/where you're processing the items and what is the expected result?

First guess would be that the 'site' is a bit more leaning towards frontend instantiation rather than backend, so it might very well be either a regression or conceptual choice, and I'm trying to get the picture :)

Hi Garvin,

I linked the GitHub issue in the description, this happened in my extension where I can select a site in a record, see here.

Actions #5

Updated by Garvin Hicking 4 months ago

Hi Daniel,

Ah sorry, I missed that one then. Probably the latest version is here with https://review.typo3.org/c/Packages/TYPO3.CMS/+/77033 that might have broken it.

That patch uses "realPid" ($params['effectivePid'], containing $realPid from getProcessingItems - and you previously used "site".

Could you maybe show a var-dump/print_r/debugUtility output maybe of what your itemsProcFunc gets passed as $params?

It feels to me like the current 'site' addition is very much tailored for "tt_content" use, resolving a page uid - and in your case of course, TCA items of another database row have something else probably stored for the records, they maybe live in a sysfolder?

However I would wonder why 'site' disappeared from your 'row' info, as it should clearly be part of the full array. Maybe because "site" is somehow treated special?! Are all other columns contained in your 'row' info? If you renamed it to something like "siteUid", would that be transported?

It could be that https://github.com/TYPO3/typo3/commit/63e3a400bce6c93b135444161f5b5066c3e8a34a affected what is passed to $params['row'], and that could be a bug.

Needs further inspection, but need to stop for now.

Updated by Daniel Dorndorf 3 months ago

Garvin Hicking wrote in #note-5:

Hi Daniel,

Ah sorry, I missed that one then. Probably the latest version is here with https://review.typo3.org/c/Packages/TYPO3.CMS/+/77033 that might have broken it.

That patch uses "realPid" ($params['effectivePid'], containing $realPid from getProcessingItems - and you previously used "site".

Could you maybe show a var-dump/print_r/debugUtility output maybe of what your itemsProcFunc gets passed as $params?

It feels to me like the current 'site' addition is very much tailored for "tt_content" use, resolving a page uid - and in your case of course, TCA items of another database row have something else probably stored for the records, they maybe live in a sysfolder?

However I would wonder why 'site' disappeared from your 'row' info, as it should clearly be part of the full array. Maybe because "site" is somehow treated special?! Are all other columns contained in your 'row' info? If you renamed it to something like "siteUid", would that be transported?

It could be that https://github.com/TYPO3/typo3/commit/63e3a400bce6c93b135444161f5b5066c3e8a34a affected what is passed to $params['row'], and that could be a bug.

Needs further inspection, but need to stop for now.

Hi Garvin,

I just had a look at whats different and printed you the output, it seems before 12.4.10 "$parameters['row']" was filled properly with all data, after it only contains the uid & pid.

See the screenshots:

v12.4.9:
Debug output on version 12.4.9

v12.4.19:
Debug output on version 12.4.19

Does this help you?
For me this is a breaking change as someone relying on that userfunc and parameters just changing without warning.

Greetings
Daniel

Actions #7

Updated by Gerrit Code Review 3 months ago

  • Status changed from Needs Feedback to Under Review

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

Actions #8

Updated by Garvin Hicking 3 months ago

@Daniel Dorndorf Thanks for getting back.

I was now able to locate the actual breaking change:

https://github.com/TYPO3/typo3/commit/7a238b3b3c56a0436e1a2805cc511ebf52452f30

This seems to be a performance optimization, preventing to get the whole row.

BackendUtility::getRecordTitle() actually receives the whole $row, but the call to this:

$recordTitle = self::getProcessedValue(
                    $table,
                    $ctrlLabel,
                    (string)$ctrlLabelValue,
                    0,
                    false,
                    false,
                    $row['uid'] ?? null,
                    $forceResult
                ) ?? '';

has no parameter to actually pass the row on to BU::getProcessedValue()

I now created a patch that would do that passing now. It applies to main, but the patch also properly seems to apply to v12 as well.

Would you be able/willing to see if the patch works out for you (in my case, it makes the whole parameters available again).

Actions #9

Updated by Daniel Dorndorf 3 months ago

Hi @Garvin Hicking,

Where can I find the patch?

I testet this by reversing the changes of the commit you send me: https://github.com/TYPO3/typo3/commit/7a238b3b3c56a0436e1a2805cc511ebf52452f30
Then it worked properly again, the site identifier in the field and the sys_language_uid is available again.

Greetings
Daniel

Actions #11

Updated by Daniel Dorndorf 3 months ago

Garvin Hicking wrote in #note-10:

@Daniel Dorndorf Here, linked in the issue: https://review.typo3.org/c/Packages/TYPO3.CMS/+/85802

@Garvin Hicking ah sry I didn't see before.
I also testet this and it worked properly again.

Actions #12

Updated by Garvin Hicking 3 months ago

Great! Maybe you can drop a vote in gerrit? ;)

Oli Bartsch will be on vacation, but we'll need to add a regression unit/functional test to ensure this doesn't break and I'll need his feedback. So it might take a bit until it gets merged.

Actions #13

Updated by Daniel Dorndorf 3 months ago

Done, I currently have a workaround implemented fetching the row manually, not optimal but will work for the time.
If this gets released I'll reverse it and increase the minimum required version and so on.

Thanks for your patch.

Actions #14

Updated by Gerrit Code Review 2 months ago

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

Actions #15

Updated by Gerrit Code Review 2 months ago

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

Actions #16

Updated by Anja Leichsenring 2 months ago

  • Related to Bug #102698: High load & response time after change itemsProcFunc in BackendUtility label functions added
Actions #17

Updated by Gerrit Code Review 2 months ago

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

Actions #18

Updated by Gerrit Code Review 2 months ago

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

Actions #19

Updated by Gerrit Code Review 2 months ago

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

Actions #20

Updated by Gerrit Code Review 2 months ago

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

Actions #21

Updated by Gerrit Code Review 2 months ago

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

Actions #22

Updated by Gerrit Code Review 2 months ago

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

Actions #23

Updated by Garvin Hicking 2 months ago

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

Updated by Benni Mack about 1 month ago

  • Status changed from Resolved to Closed
Actions

Also available in: Atom PDF