-
Notifications
You must be signed in to change notification settings - Fork 88
Description
Сообщение об ошибке / Error message
PHP Fatal error: Uncaught TypeError: Cannot access offset of type string
Резюме / Summary
When adding the property &toSeparatePlaceholders
on the pdoPage
snippet the pdoResources snippet (forward call) causes a PHP Fatal error: Uncaught TypeError: Cannot access offset of type string
so far I know from PHP >= 8
Как воспроизвести проблему, включая пользовательский код, если это необходимо. / How to reproduce the problem, including custom code if needed
Call the snippet of pdoPage
with the property &toSeparatePlaceholders
.
Наблюдаемое поведение / Observed behavior
A nested pdoResources
call causes the $output to be a string on line 40. At line 58 the $log is added to the $output assuming it is an array. This line should be refactored in.
if(is_array($log)){
$output['log'] = $log;
$modx->setPlaceholders($output, $toSeparatePlaceholders);
}else {
$modx->setPlaceholders(['log' => $log], $toSeparatePlaceholders);
}
Ожидаемое поведение / Expected behavior
Как это должно вести себя после следующих шагов выше. / How it should behave after following the steps above.
No PHP fatal error ;-)
Environment
MODX 2.8.5 with PHP 8.1