[BUGFIX] Followup: Replace shortcut item icons with sprites 23/34723/2
authorFrans Saris <franssaris@gmail.com>
Fri, 28 Nov 2014 07:41:22 +0000 (08:41 +0100)
committerFrank Nägler <typo3@naegler.net>
Sat, 29 Nov 2014 14:30:54 +0000 (15:30 +0100)
If a the linked record of a shortcut is deleted you get a Fatal error
that breaks the BE.

This patch makes sure that the correct variable types are used for
IconUtility::getSpriteIconForRecord()

Resolves: #63319
Releases: master
Change-Id: Ia7aa5237b24c0190ad87b9353f29735682cb5ebb
Reviewed-on: http://review.typo3.org/34723
Reviewed-by: Andreas Fernandez <andreas.fernandez@aspedia.de>
Tested-by: Andreas Fernandez <andreas.fernandez@aspedia.de>
Reviewed-by: Frank Nägler <typo3@naegler.net>
Tested-by: Frank Nägler <typo3@naegler.net>
typo3/sysext/backend/Classes/Backend/ToolbarItems/ShortcutToolbarItem.php

index 37dfe1f..7cddfd8 100644 (file)
@@ -661,7 +661,7 @@ class ShortcutToolbarItem implements ToolbarItemInterface {
                                        );
                                        $result = $databaseConnection->exec_SELECT_queryArray($sqlQueryParts);
                                        $row = $databaseConnection->sql_fetch_assoc($result);
-                                       $icon = IconUtility::getSpriteIconForRecord($table, $row, array('title' => $titleAttribute));
+                                       $icon = IconUtility::getSpriteIconForRecord($table, (array)$row, array('title' => $titleAttribute));
                                } elseif ($shortcut['type'] == 'new') {
                                        $icon = IconUtility::getSpriteIconForRecord($table, array(), array('title' => $titleAttribute));
                                }