Bug #25372
closedPHP Catchable Fatal Error: t3lib_iconWorks::getSpriteIconForRecord() must be an array (workspaces situation)
0%
Description
In Typo3 4.5.2, it is not possible to open some pages in the Web-Page-View.
This is the error message:
PHP Catchable Fatal Error: Argument 2 passed to t3lib_iconWorks::getSpriteIconForRecord() must be an array, null given, called in typo3/sysext/cms/layout/class.tx_cms_layout.php on line 686 and defined in t3lib/class.t3lib_iconworks.php line 762
On the contrary, one can open the same pages in the Web-List-View. Also, other pages in the same page tree can easily be opened.
The above mentioned problem could be fixed by adding the following to line 686 of typo3/sysext/cms/layout/class.tx_cms_layout.php:
if (!is_array($lpRecord)) $lpRecord = array($lpRecord);
It happens in an environment with to defined languages and three workspaces. It is not possible to open the pages in the Live-Workspace and the "Entwurfsarbeitsumgebung"-Workspace. But in the Draft-Workspace, one can open the page.
(issue imported from #M18010)
Files
Updated by Max Mishyn over 13 years ago
- Target version deleted (
0)
Same issue takes place in getIcon($row) at t3lib/class.t3lib_treeview.php at line 633 (TYPO3 v 4.5.2).
BE users with administrative rights are not affected by this issue. One users with access defined by DM mounted points facing it.
I aw able to fix it by adding following condition check:
if (is_array($row)) {
$icon = t3lib_iconWorks::getSpriteIconForRecord($this->table, $row, array(.....
}
Updated by Arpad Fodor about 13 years ago
Hi,
I also reproduced the error in the backend when some page content elements are in a workspace.
To provide a more hopefully general solution for this problem, I tried to fix the method getSpriteIconForRecord in the file t3lib/class.t3lib_iconworks.php since this seems to be the cause for this error.
Current code:public static function getSpriteIconForRecord($table, array $row, array $options = array()) {
// Code of the method
}
Possible new code:public static function getSpriteIconForRecord($table, $row, $options = array()) {
if (!is_array($row) || count($row) < 1){
return '';
}
// Code of the method
}
1. Remove the array in front of the parameter $row since this forces the caller to provide an array. As I counted ca. 87 usages of this method, it is easier to do this.
2. do the check, if the given parameter $row is really an array and if it has any elements.
Please note:
These checks may not fix all issues...
Updated by Fedir RYKHTIK about 13 years ago
- File 25372.diff 25372.diff added
Confirmation of the issue.
Just had the same problem after upgrading of existing site from 4.4.4 to 4.4.10, so it's not only 4.5.x bug.
Site has WS configured, some workspaces had these issue, some not. Workspaces were configured with exactly the same parameters.
The bug was resolved locally with patch added into the attachment.
Updated by Fedir RYKHTIK about 13 years ago
Looks like it's related to #25409, probably comes from deleted elements
Updated by Michael Fritz almost 13 years ago
- Target version set to 4.5.9
I just changed one line in class.tx_cms_layout.php and it words.
OLD: $lPLabel = $GLOBALS['SOBE']->doc->wrapClickMenuOnIcon(t3lib_iconWorks::getSpriteIconForRecord('pages_language_overlay', $lpRecord), $lpRecord['uid']) .
NEW: $lPLabel = $GLOBALS['SOBE']->doc->wrapClickMenuOnIcon(t3lib_iconWorks::getSpriteIconForRecord('pages_language_overlay', is_array($lpRecord)?$lpRecord:array()), $lpRecord['uid']) .
Updated by Ernesto Baschny almost 13 years ago
- Target version changed from 4.5.9 to 4.5.12
Updated by Philipp Gampe over 12 years ago
@Michael mind pushing a patch to gerrit?
Updated by Jigal van Hemert over 12 years ago
What is the reason the the pages_language_overlay record for that language is empty? Using an empty array is just masking the actual problem and not a real solution.
Updated by Bart Dubelaar over 12 years ago
This bug is also affecting the filter function in the page tree when working in a draft workspace.
Updated by Sascha Egerer about 11 years ago
Can't reproduce this issue in current master (6.2).
Updated by Ernesto Baschny about 11 years ago
- Subject changed from PHP Catchable Fatal Error: t3lib_iconWorks::getSpriteIconForRecord() must be an array to PHP Catchable Fatal Error: t3lib_iconWorks::getSpriteIconForRecord() must be an array (workspaces situation)
- Category set to Workspaces
- Target version deleted (
4.5.12) - Is Regression set to No
This seem to be a bug in typo3/sysext/backend/Classes/View/PageLayoutView.php in workspace mode. Remains to be further analysed.
Updated by Ernesto Baschny about 11 years ago
- Status changed from New to Needs Feedback
In fact there even seem to be a potential solution. Check out #21084 and the patch in the review queue if this solves it for you.
Updated by Alexander Opitz almost 11 years ago
It would be nice if we can get response from the users if the patch from #21084 fixes this problem here.
Updated by Alexander Opitz over 10 years ago
No feedback within the last 90 days => closing this ticket.
If you think that this is the wrong decision or experience this issue again, then please write to the mailing list typo3.teams.bugs with issue number and an explanation or open a new ticket and add a relation to this ticket number.
Updated by Alexander Opitz over 10 years ago
- Status changed from Needs Feedback to Closed