Project

General

Profile

Actions

Bug #75834

closed

removeItems, backendLayouts, pageTSconfig

Added by Stefan Froemken over 8 years ago. Updated about 6 years ago.

Status:
Closed
Priority:
Should have
Assignee:
-
Category:
FormEngine aka TCEforms
Start date:
2016-04-21
Due date:
% Done:

100%

Estimated time:
TYPO3 Version:
7
PHP Version:
5.6
Tags:
Complexity:
Is Regression:
No
Sprint Focus:

Description

Hello Core-Team,

in privious TYPO3 Versions you have following structure:

if (isset($config['itemsProcFunc']) && $config['itemsProcFunc']) {
    $selItems = $this->procItems($selItems, $PA['fieldTSConfig']['itemsProcFunc.'], $config, $table, $row, $field);
}
// Possibly remove some items:
$removeItems = t3lib_div::trimExplode(',', $PA['fieldTSConfig']['removeItems'], 1);

Execute itemsProcFunc and THEN remove items by pageTSconfig

Now you have a structure like that:

$fieldConfig['config']['items'] = $this->removeItemsByKeepItemsPageTsConfig();
$fieldConfig['config']['items'] = $this->addItemsFromPageTsConfig();
$fieldConfig['config']['items'] = $this->removeItemsByRemoveItemsPageTsConfig();

...

$removedItems = array_diff_key($removedItems, $fieldConfig['config']['items']);

// Resolve "itemsProcFunc" 
if (!empty($fieldConfig['config']['itemsProcFunc'])) {
  $fieldConfig['config']['items'] = $this->resolveItemProcessorFunction();
}

Remove items defined by pageTSconfig and THEN execute itemsProcFunc.

So we can't remove items, which are generated by userFuncs anymore.

Next step: backend_layouts:
To remove the "none" entry, which was defined by TCA, we have to use removeItems. To remove entries, generated by itemsProcFunc, we have to use options.backendLayout.exclude. Not really userFriendly. BUT: That entry will be removed in BOTH select fields. That's not our goal. We only want to remove one entry from backend_layout and nothing more.

Maybe it would be a good start to differ them by adding a new option like:

options.backendLayoutNext.exclude

Stefan


Related issues 2 (0 open2 closed)

Related to TYPO3 Core - Bug #82980: Handling of mixed string and 0 broken for keepItems and removeItems page tsClosed2017-11-12

Actions
Related to TYPO3 Core - Bug #85142: Recent reordering of TCA select items processing makes it impossible to post-process foreign_table itemsClosed2018-06-02

Actions
Actions

Also available in: Atom PDF