Bug #58846
closedBug #52551: Introduce Constants for t3ver_state
Invalid value for TYPO3\CMS\Core\Versioning\VersionState
100%
Description
In IconUtility::getIcon($table, $row = array(), $shaded = FALSE) there is not proper check if $row['t3ver_state'] is set with this exception as a result when only called with $table set:
Uncaught TYPO3 Exception #1381512761: Invalid value for TYPO3\CMS\Core\Versioning\VersionState (More information) TYPO3\CMS\Core\Type\Exception\InvalidEnumerationValueException thrown in file /var/www/typo3/master/typo3_src-git/typo3/sysext/core/Classes/Type/Enumeration.php in line 67. 12 TYPO3\CMS\Core\Type\Enumeration::__construct("") /var/www/typo3/master/typo3_src-git/typo3/sysext/core/Classes/Type/Enumeration.php: 00189: $currentClass = get_called_class(); 00190: if (!is_object($value) || get_class($value) !== $currentClass) { 00191: $value = new $currentClass($value); 00192: } 00193: return $value; 11 TYPO3\CMS\Core\Type\Enumeration::cast("") /var/www/typo3/master/typo3_src-git/typo3/sysext/backend/Classes/Utility/IconUtility.php: 00167: // Shadow 00168: if (!empty($GLOBALS['TCA'][$table]['ctrl']['versioningWS']) ) { 00169: switch (VersionState::cast($row['t3ver_state'])) { 00170: case new VersionState(VersionState::NEW_PLACEHOLDER): 00171: return 'gfx/i/shadow_hide.png'; 10 TYPO3\CMS\Backend\Utility\IconUtility::getIcon("tx_news_domain_model_news", "", NULL) /var/www/typo3/master/typo3_src-git/typo3/sysext/backend/Classes/Toolbar/ShortcutToolbarItem.php: 00650: $icon = IconUtility::getIcon($table, $row, $this->backPath); 00651: } elseif ($shortcut['type'] == 'new') { 00652: $icon = IconUtility::getIcon($table, '', $this->backPath); 00653: } 00654: $icon = IconUtility::skinImg($this->backPath, $icon, '', 1); 9 TYPO3\CMS\Backend\Toolbar\ShortcutToolbarItem::getShortcutIcon(array, array) /var/www/typo3/master/typo3_src-git/typo3/sysext/backend/Classes/Toolbar/ShortcutToolbarItem.php: 00312: } 00313: $shortcut['group'] = $shortcutGroup; 00314: $shortcut['icon'] = $this->getShortcutIcon($row, $shortcut); 00315: $shortcut['iconTitle'] = $this->getShortcutIconTitle($shortcut['label'], $row['module_name'], $row['M_module_name']); 00316: $shortcut['action'] = 'jump(unescape(\'' . rawurlencode($this->getTokenUrl($row['url'])) . '\'),\'' . $moduleName . '\',\'' . $moduleParts[0] . '\', ' . (int)$pageId . ');'; 8 TYPO3\CMS\Backend\Toolbar\ShortcutToolbarItem::initShortcuts() /var/www/typo3/master/typo3_src-git/typo3/sysext/backend/Classes/Toolbar/ShortcutToolbarItem.php: 00110: ); 00111: $this->shortcutGroups = $this->initShortcutGroups(); 00112: $this->shortcuts = $this->initShortcuts(); 00113: } 00114: 7 TYPO3\CMS\Backend\Toolbar\ShortcutToolbarItem::__construct(TYPO3\CMS\Backend\Controller\BackendController)
Easy to reproduce:
- Create a be shortcut to a create tt_content element form
- Reload back-end
Updated by Gerrit Code Review over 10 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/30152
Updated by Gerrit Code Review over 10 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/30152
Updated by Gerrit Code Review over 10 years ago
Patch set 3 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/30152
Updated by Gerrit Code Review over 10 years ago
Patch set 4 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/30152
Updated by Frans Saris over 10 years ago
- Status changed from Under Review to Resolved
- % Done changed from 0 to 100
Applied in changeset 3d5143b61e36a71e520910c8c79e315e756768bf.