Bug #77284
closedUSERDEF2 ItemState set through a itemArrayProcFunc is ignored - USERDEF2 TypoScript Conf never used
100%
Description
After setting menuItems in a itemArayProcFunc to ITEM_STATE USERDEF2, the items will be formatted as one of the other states.
USERDEF2 is fully ignored. USERDEF1 and all other states are working.
I looked into the core code, and found the Bug.
The bug sits in the procesItemStates method of TYPO3\CMS\Frontend\ContentObject\Menu\AbstractMenuContentObject Class.
There is a wrong conditional used in the USERDEF2 handling:
// Prepare Userdefined settings if (!empty($this->mconf['USERDEF2'])) { $USERDEF2conf = null; $USERDEF2ROconf = null; // Find active foreach ($NOconf as $key => $val) { if ($this->isItemState('USERDEF2', $key)) { // If this is the first active, we must generate USERDEF2. if ($USERDEF2conf) { $USERDEF2conf = $this->tmpl->splitConfArray($this->mconf['USERDEF2.'], $splitCount); // Prepare active rollOver settings, overriding normal active settings if (!empty($this->mconf['USERDEF2RO'])) { $USERDEF2ROconf = $this->tmpl->splitConfArray($this->mconf['USERDEF2RO.'], $splitCount); } } // Substitute normal with active if (isset($USERDEF2conf[$key])) { $NOconf[$key] = $USERDEF2conf[$key]; } // If rollOver on normal, we must apply a state for rollOver on the active if ($ROconf) { // If RollOver on active then apply this $ROconf[$key] = !empty($USERDEF2ROconf[$key]) ? $USERDEF2ROconf[$key] : $USERDEF2conf[$key]; } } } }
The buggy condition is:
if ($USERDEF2conf) {
This condition is wrong, because
NULL === TRUE ==> FALSE
This condition should be changed to
if ($USERDEF2conf === null) {
Found in 7.6.9, but still in the master branch.
Updated by Gerrit Code Review over 8 years 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/49241
Updated by Gerrit Code Review over 8 years 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/49241
Updated by Gerrit Code Review over 8 years ago
Patch set 1 for branch TYPO3_7-6 of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/49257
Updated by Stefan Bürk over 8 years ago
- Status changed from Under Review to Resolved
- % Done changed from 0 to 100
Applied in changeset c38065f3beab21ab61c3e1a14530666183a6ffc4.