Warning: json_decode() expects parameter 1 to be string, array given
akroii opened this issue · 1 comments
akroii commented
Bug description
When I open the reader page i got an error after I turn on the debug mode.
Steps to reproduce
Turn off debug-mode and open detail page.
My Gallery Snippet:
<?php foreach($this->ad['images'] as $imageGroup): ?>
<?php foreach($imageGroup as $key=>$img): ?>
<?php if($img['@size'] == "XL"): ?>
<div class="slide"><img src="<?php $img['@url'] ?>" /></div>
<?php endif; ?>
<?php endforeach; ?>
<?php endforeach; ?>
Expected behavior
Should display gallery. But instead i got an error in debug mode.
Screenshots
ErrorException:
Warning: json_decode() expects parameter 1 to be string, array given
at vendor/pdir/mobilede-sync-bundle/src/Api/MobileDe.php:186
at Pdir\MobileDeSyncBundle\Api\MobileDe->getGalleryImages()
(vendor/pdir/mobilede-bundle/src/Elements/ReaderElement.php:164)
at Pdir\MobileDeBundle\Elements\ReaderElement->compile()
(vendor/contao/core-bundle/src/Resources/contao/elements/ContentElement.php:247)
at Contao\ContentElement->generate()
(vendor/pdir/mobilede-bundle/src/Elements/ReaderElement.php:73)
at Pdir\MobileDeBundle\Elements\ReaderElement->generate()
(vendor/contao/core-bundle/src/Resources/contao/library/Contao/Controller.php:580)
at Contao\Controller::getContentElement()
(vendor/contao/core-bundle/src/Resources/contao/modules/ModuleArticle.php:187)
at Contao\ModuleArticle->compile()
(vendor/contao/core-bundle/src/Resources/contao/modules/Module.php:209)
at Contao\Module->generate()
(vendor/contao/core-bundle/src/Resources/contao/modules/ModuleArticle.php:74)
at Contao\ModuleArticle->generate()
(vendor/contao/core-bundle/src/Resources/contao/library/Contao/Controller.php:520)
at Contao\Controller::getArticle()
(vendor/contao/core-bundle/src/Resources/contao/library/Contao/Controller.php:371)
at Contao\Controller::getFrontendModule()
(vendor/contao/core-bundle/src/Resources/contao/pages/PageRegular.php:168)
at Contao\PageRegular->prepare()
(vendor/contao/core-bundle/src/Resources/contao/pages/PageRegular.php:48)
at Contao\PageRegular->getResponse()
(vendor/contao/core-bundle/src/Resources/contao/controllers/FrontendIndex.php:339)
at Contao\FrontendIndex->renderPage()
(vendor/symfony/http-kernel/HttpKernel.php:158)
at Symfony\Component\HttpKernel\HttpKernel->handleRaw()
(vendor/symfony/http-kernel/HttpKernel.php:80)
at Symfony\Component\HttpKernel\HttpKernel->handle()
(vendor/symfony/http-kernel/Kernel.php:201)
at Symfony\Component\HttpKernel\Kernel->handle()
(web/index.php:31)
at require('/srv/www/schmidt/public/dev/web/index.php')
(web/app.php:4)
Environment
PHP 7.4.9
MobileDE: 2.6.4
Contao 4.9.5
akroii commented
After i copied the lines from original template (https://github.com/pdir/mobilede-bundle/blob/master/src/Resources/contao/templates/elements/ce_mobilede_reader.html5#L22-L30), the gallery works as aspacted.