Issue Bug Closed

#17360Tools -> DB Check -> Manage Reference Index crashes with Fatal error: Cannot use string offset as an array

Thomas Kowtsch 06/06/07, 13:59 updated 10/02/18, 12:32

Description

I tried to migrate a v3.8 installation to 4.1.1; including the update to the most recent XAMPP package.
With every try to access Tools -> DB Check -> Manage Reference Index -> Update I just got the error
“Fatal error: Cannot use string offset as an array in D:\xampp\htdocs\intranet\typo3conf\ext\kb_conttable\class.tx_t3lib_befunc.php on line 87” [line number might be different due to conversion to DOS file format]

Affected is function “getFlexFormDS_postProcessDS”; starting after line
$newDSArray = $dsArray;

By adding some debugging lines I noticed that sometimes the parameter $dsArray isn’t an array at all; printing the variable by var_dump() comes up with [[string(28) “Line 1: Invalid document end”]]

In order to make the function work at all, I put in the following code right before the array assignment:

if (!is_array($dsArray)){
return false;
}

Handling the error properly is the minimum requirement at this point; avoiding this scenario would be even better.
If anyone can tell me how to find out who or what is calling the function (in this error case) I can help to get the root cause fixed.

(issue imported from #M5746)

Reviews 0

No change resolves or names this issue in its commit message, and no comment links one.