Project

General

Profile

Actions

Bug #91611

closed

itemProcFunc is failing due to AbstractItemProvider

Added by David Bruchmann over 4 years ago. Updated about 4 years ago.

Status:
Closed
Priority:
Should have
Assignee:
-
Category:
Backend API
Target version:
-
Start date:
2020-06-08
Due date:
% Done:

0%

Estimated time:
TYPO3 Version:
9
PHP Version:
Tags:
backend, ajax, itemProcFunc, FormDataProvider
Complexity:
Is Regression:
Sprint Focus:

Description

in
TYPO3\CMS\Backend\Form\FormDataProvider\AbstractItemProvider::resolveItemProcessorFunction
the wrong results are returned. I checked it in TYPO3 9.5 but verified the code of version 10.4 too and it is at least fundamentally the same:

Here the individual function is called with prepared $processorParameters:

        $processorParameters = [
            // Function manipulates $items directly and return nothing
            'items' => &$items,
            'config' => $config,
            'TSconfig' => $pageTsProcessorParameters,
            'table' => $table,
            'row' => $result['databaseRow'],
            'field' => $fieldName,
        ];
        if (!empty($result['flexParentDatabaseRow'])) {
            $processorParameters['flexParentDatabaseRow'] = $result['flexParentDatabaseRow'];
        }
        try {
            GeneralUtility::callUserFunction($config['itemsProcFunc'], $processorParameters, $this);
        } catch (\Exception $exception) { ... }

Afterwards `$items` is returned.
The fault is that $items is not the same like $processorParameters['items'] and $items is un-altered still the old data.
I changed the last method-line to

    return $processorParameters['items'];

and got the expected results.

Actions

Also available in: Atom PDF