Project

General

Profile

Actions

Bug #69056

closed

DataHandler - Illegal string offset 'currentLangId'

Added by Joerg Kummer over 9 years ago. Updated about 6 years ago.

Status:
Closed
Priority:
Should have
Assignee:
-
Category:
DataHandler aka TCEmain
Target version:
-
Start date:
2015-08-14
Due date:
% Done:

100%

Estimated time:
TYPO3 Version:
7
PHP Version:
5.5
Tags:
Complexity:
Is Regression:
No
Sprint Focus:

Description

CMS 7.5-dev
Affected method TYPO3\CMS\Core\DataHandling\DataHandler::checkValueForFlex()

#1: PHP Warning: Illegal string offset 'currentLangId' in /Users/jok/Sites/_typo3_srcs/typo3_src-7.4.0/typo3/sysext/core/Classes/DataHandling/DataHandler.php line 2449

How to reproduce:
You need a CE type plugin, with XML data, stored in DB tt_content.pi_flexform (fx felogin) with an empty <meta></meta> element.
The XML data structure would not contain any </meta> elements. Add an empty <meta><meta> element to the XML data.
In my case this emty <meta/> element extant from earlier CMS 4.x versions (fx. EXT:newloginbox).
If so, you cant save this CE, during method checkValueForFlex() fails.

How to solve:

A) Alter (wrong) database items
Find such CE elements, and alter the XML data, to remove empty elements.

SELECT uid,pid,header,pi_flexform FROM tt_content WHERE pi_flexform LIKE '%<meta>%'

B) Bugfix DataHandler php issue
Change condition for unset 'currentLangId' value in TYPO3\CMS\Core\DataHandling\DataHandler::checkValueForFlex() line 2449
from

is_array($currentValueArray['meta']['currentLangId'])

to
isset($currentValueArray['meta']['currentLangId'])

which solves PHP warning for array key, which not exists.

Actions

Also available in: Atom PDF