Bug #85622
closeditemsProcFunc in TCA -> select with foreign_table works not correctly
0%
Description
If you use itemProcFunc in e.g. a category field in your TCA, you have no access to items anymore. You just can add new list items but you can't hide items, which would be rendered or modify items.
'categories' => array(
'exclude' => 0,
'label' => 'Example',
'config' => array(
'type' => 'select',
'renderType' => 'selectMultipleSideBySide',
'foreign_table' => 'tx_example_domain_model_category',
'MM' => 'tx_example_item_category_mm',
'itemsProcFunc' => 'Vendor\\Example\\Utility\\TcaHelper->modifyCategorys',
'size' => 10,
'autoSizeMax' => 30,
'minitems' => 1,
'maxitems' => 9999,
'multiple' => 0,
),
),
And some code stuff from the Custom Method
class TcaHelper {
/**
* @param $config
* @param $pObj
*/
public function modifyCategorys(array &$config, &$pObj) {
\TYPO3\CMS\Extbase\Utility\DebuggerUtility::var_dump(array(
'$config' => $config,
'$pObj' => $pObj,
), __CLASS__ . '@' . __LINE__);
...
$config['items'] is empty regardless of the items in the other table.
Updated by Wolfgang Klinger about 5 years ago
- Priority changed from Should have to Must have
I can confirm that,
// Resolve "itemsProcFunc" if (!empty($fieldConfig['config']['itemsProcFunc'])) {
is called too early
Updated by André Buchmann about 5 years ago
I can also confirm that. After upgrade from TYPO3 8.7 to 9.5 I have the problem, that the foreign_table items are loaded after my itemsProcFunc overrides.
Why was the "Resolve itemsProcFunc"- block moved upwards in TYPO3 9.5?
TYPO3 8.7 https://github.com/TYPO3/TYPO3.CMS/blob/TYPO3_8-7/typo3/sysext/backend/Classes/Form/FormDataProvider/TcaSelectItems.php#L74
TYPO3 9.5 https://github.com/TYPO3/TYPO3.CMS/blob/9.5/typo3/sysext/backend/Classes/Form/FormDataProvider/TcaSelectItems.php#L48
It was changed here: https://forge.typo3.org/issues/75834
Updated by Torben Hansen almost 5 years ago
- Category set to FormEngine aka TCEforms
Updated by Torben Hansen almost 5 years ago
Same problem here too. There is a pending patch on Gerrit (https://review.typo3.org/c/Packages/TYPO3.CMS/+/57185), which needs rebase and tests fixed.
Updated by Torben Hansen almost 5 years ago
- Related to Bug #85142: Recent reordering of TCA select items processing makes it impossible to post-process foreign_table items added
Updated by Oliver Bartsch over 3 years ago
- Status changed from New to Closed
Hi,
as mentioned by Torben this was resolved with #85142. I therefore was not able to reproduce this anymore with the provided configuration.
I will close this issue now. If you feel there is still something that does not work, please let me know and I will re-open the ticket.