Project

General

Profile

Actions

Bug #25372

closed

PHP Catchable Fatal Error: t3lib_iconWorks::getSpriteIconForRecord() must be an array (workspaces situation)

Added by Ulrich about 13 years ago. Updated about 10 years ago.

Status:
Closed
Priority:
Should have
Assignee:
-
Category:
Workspaces
Target version:
-
Start date:
2011-03-22
Due date:
% Done:

0%

Estimated time:
TYPO3 Version:
4.5
PHP Version:
5.3
Tags:
Complexity:
Is Regression:
No
Sprint Focus:

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

25372.diff (1.42 KB) 25372.diff Fedir RYKHTIK, 2011-09-07 15:28

Related issues 3 (0 open3 closed)

Related to TYPO3 Core - Bug #39197: Pagetree Filtering can't handle records moved in draft - errors and blanksClosed2012-07-23

Actions
Related to TYPO3 Core - Bug #21084: Pages in Workspaces are not editable anymore, course of a "PHP Catchable Fatal Error"ClosedSusanne Moog2010-08-09

Actions
Is duplicate of TYPO3 Core - Bug #25409: t3lib_iconWorks::getSpriteIconForRecord() isn't workspace awareClosed2011-03-28

Actions
Actions #1

Updated by Max Mishyn almost 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(.....
}

Actions #2

Updated by Arpad Fodor over 12 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...

Actions #3

Updated by Fedir RYKHTIK over 12 years ago

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.

Actions #4

Updated by Fedir RYKHTIK over 12 years ago

Looks like it's related to #25409, probably comes from deleted elements

Actions #5

Updated by Michael Fritz over 12 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']) .

Actions #6

Updated by Ernesto Baschny about 12 years ago

  • Target version changed from 4.5.9 to 4.5.12
Actions #7

Updated by Philipp Gampe about 12 years ago

@Michael mind pushing a patch to gerrit?

Actions #8

Updated by Jigal van Hemert about 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.

Actions #9

Updated by Bart Dubelaar almost 12 years ago

This bug is also affecting the filter function in the page tree when working in a draft workspace.

Actions #10

Updated by Sascha Egerer over 10 years ago

Can't reproduce this issue in current master (6.2).

Actions #11

Updated by Ernesto Baschny over 10 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.

Actions #12

Updated by Ernesto Baschny over 10 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.

Actions #13

Updated by Alexander Opitz over 10 years ago

It would be nice if we can get response from the users if the patch from #21084 fixes this problem here.

Actions #14

Updated by Alexander Opitz about 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.

Actions #15

Updated by Alexander Opitz about 10 years ago

  • Status changed from Needs Feedback to Closed
Actions

Also available in: Atom PDF