Project

General

Profile

Actions

Bug #67183

closed

Exception in \TYPO3\CMS\Frontend\Aspect\FileMetadataOverlayAspect::languageAndWorkspaceOverlay

Added by André Spindler almost 9 years ago. Updated over 8 years ago.

Status:
Closed
Priority:
Must have
Assignee:
-
Category:
Workspaces
Target version:
-
Start date:
2015-05-28
Due date:
% Done:

0%

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

Description

Error is "Passed variable is not an array or object, using empty array instead" in line "$data->exchangeArray($overlayedMetaData);"

I got this exception today in a workspace preview - it is the cause of an type error. check in the line above must be done against FALSE, not NULL.
TYPO3: 6.2.12
PHP: 5.3.10-1ubuntu3.18

Code:

$overlaidMetaData = $data->getArrayCopy();
$this->getTsfe()->sys_page->versionOL('sys_file_metadata', $overlaidMetaData);
$overlaidMetaData = $this->getTsfe()->sys_page->getRecordOverlay(
    'sys_file_metadata',
    $overlaidMetaData,
    $this->getTsfe()->sys_language_content,
    $this->getTsfe()->sys_language_contentOL
);
if ($overlaidMetaData !== NULL) {
    $data->exchangeArray($overlaidMetaData);
}

If there is no overlay, versionOL() sets the given data array ($overlaidMetaData) to FALSE (instead of unset() it).
So FALSE is passed to getRecordOverlay() as second parameter. But if it is not an array (as has no index "uid"), getRecordOverlay() does just nothing (ok, hooks are processed) and returns just this FALSE.
So we run into the exception when FALSE is checked against NULL - and it indeed not NULL and we replace the data of the array object with FALSE...

So it is just a small fix to replace NULL in the check with FALSE.

Actions #1

Updated by Alexander Opitz almost 9 years ago

  • Status changed from New to Needs Feedback
  • Target version changed from 6.2.13 to 6.2.14

There are some Workspace fixes in the upcoming 6.2.13.
Please test and report back, if the issue is resolved or not.

Actions #2

Updated by Alexander Opitz over 8 years ago

  • Status changed from Needs Feedback to Closed
  • Target version deleted (6.2.14)

No feedback within the last 90 days => closing this issue.

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

Also available in: Atom PDF