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 #1

Updated by Joerg Kummer over 9 years ago

Also in current CMS 6.2 version

Actions #2

Updated by Gerrit Code Review over 9 years ago

  • Status changed from New to Under Review

Patch set 1 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at http://review.typo3.org/42616

Actions #3

Updated by Gerrit Code Review over 9 years ago

Patch set 2 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at http://review.typo3.org/42616

Actions #4

Updated by Gerrit Code Review over 9 years ago

Patch set 3 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at http://review.typo3.org/42616

Actions #5

Updated by Gerrit Code Review over 9 years ago

Patch set 1 for branch TYPO3_6-2 of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at http://review.typo3.org/42641

Actions #6

Updated by Joerg Kummer over 9 years ago

  • Status changed from Under Review to Resolved
  • % Done changed from 0 to 100
Actions #7

Updated by Benni Mack about 6 years ago

  • Status changed from Resolved to Closed
Actions

Also available in: Atom PDF