[BUGFIX] BE shortcuts do not show up for editors 98/31198/2
authorFrans Saris <franssaris@gmail.com>
Fri, 27 Jun 2014 18:16:16 +0000 (20:16 +0200)
committerMarkus Klein <klein.t3@mfc-linz.at>
Sat, 28 Jun 2014 17:11:48 +0000 (19:11 +0200)
Due to some wrong or missing checks the link to create a shortcut
to a create new record form misses the correct name of the
"motherModName" as a result the shortcut links are not rendered
for non-admins. For admins these links do not work if PHP notices
are transformed to exceptions.

Resolves: #59946
Releases: 6.3, 6.2
Change-Id: I9acd74fd5dfefea62badc79e42e380466ce6c497
Reviewed-on: https://review.typo3.org/31198
Reviewed-by: Markus Klein
Tested-by: Markus Klein
typo3/sysext/backend/Classes/Form/DataPreprocessor.php
typo3/sysext/backend/Classes/Template/DocumentTemplate.php
typo3/sysext/backend/Classes/Toolbar/ShortcutToolbarItem.php

index 4c3843f..c7540d1 100644 (file)
@@ -135,7 +135,7 @@ class DataPreprocessor {
                                                        }
                                                }
                                                // Default values as submitted:
-                                               if (is_array($this->defVals[$table])) {
+                                               if (!empty($this->defVals[$table]) && is_array($this->defVals[$table])) {
                                                        foreach ($this->defVals[$table] as $theF => $theV) {
                                                                if (isset($GLOBALS['TCA'][$table]['columns'][$theF])) {
                                                                        $newRow[$theF] = $theV;
index 7843f23..02b9175 100644 (file)
@@ -607,7 +607,7 @@ function jumpToUrl(URL) {
                if (preg_match('/typo3\\/mod\\.php$/', $pathInfo['path']) && isset($GLOBALS['TBE_MODULES']['_PATHS'][$modName])) {
                        $storeUrl = '&M=' . $modName . $storeUrl;
                }
-               if ($motherModName === '1') {
+               if ((int)$motherModName === 1) {
                        $mMN = '&motherModName=\'+top.currentModuleLoaded+\'';
                } elseif ($motherModName) {
                        $mMN = '&motherModName=' . rawurlencode($motherModName);
index 5a3ce15..744c0fb 100644 (file)
@@ -636,7 +636,7 @@ class ShortcutToolbarItem implements \TYPO3\CMS\Backend\Toolbar\ToolbarItemHookI
                                        $row = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($result);
                                        $icon = IconUtility::getIcon($table, $row, $this->backPath);
                                } elseif ($shortcut['type'] == 'new') {
-                                       $icon = IconUtility::getIcon($table, '', $this->backPath);
+                                       $icon = IconUtility::getIcon($table, array(), $this->backPath);
                                }
                                $icon = IconUtility::skinImg($this->backPath, $icon, '', 1);
                                break;