Zitat von
Spooky
Nutze den Debug-Modus und poste die Stack Traces.
super, danke! Daran hab ich jetzt nicht gedacht.
Stack Trace
Code:
ErrorException:
Warning: Invalid argument supplied for foreach()
at vendor/mybundle/articleext/src/Resources/contao/classes/ArticleExt.php:36
at MyBundle\ElementsBundle\ArticleExtension\Resources\contao\classes\ArticleExt->insertExt()
(vendor/contao/core-bundle/src/Resources/contao/modules/ModuleArticle.php:261)
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:510)
at Contao\Controller::getArticle()
(vendor/contao/core-bundle/src/Resources/contao/library/Contao/Controller.php:372)
at Contao\Controller::getFrontendModule()
(vendor/contao/core-bundle/src/Resources/contao/pages/PageRegular.php:172)
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('/var/www/html/web/index.php')
(web/app.php:4)
Ich habe die Artikel erweitert mit Feldern
dca:
PHP-Code:
$GLOBALS['TL_DCA']['tl_article']['fields']['article_ext'] = array (
'label' => &$GLOBALS['TL_LANG']['tl_article']['article_ext'],
'inputType' => 'select',
'options' => array(
'class-1',
'class-2'
),
'reference' => &$GLOBALS['TL_LANG']['tl_article']['article_class_values'],
'eval' => array(
'includeBlankOption' => true,
'mandatory' => false,
'maxlength' => 255,
'tl_class' => 'w50',
'multiple' => true,
'chosen' => true
),
'sql' => "varchar(255) NOT NULL default ''"
);
insertExt: (Zeile 36)
PHP-Code:
foreach(unserialize($tpl->article_ext) as $value) {
$article_class .= ' '.$value;
}
wenn ich das ganze jetzt so ändere:
PHP-Code:
if($tpl->article_ext) {
foreach(unserialize($tpl->article_ext) as $value) {
$article_class .= ' '.$value;
}
}
dann wird kein 404er mehr angezeigt.
Was ich dann aber nicht ganz verstehe ist, dass die anderen Seiten bisher funktioniert haben
-EDIT-
Schreibfehler
Lesezeichen