Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Formularfelder werden nicht angezeigt #9

Open
erichelch opened this issue Nov 4, 2017 · 2 comments
Open

Formularfelder werden nicht angezeigt #9

erichelch opened this issue Nov 4, 2017 · 2 comments

Comments

@erichelch
Copy link

Folgender Fehler bei der Anzeige einer Umfrage im Frontend (Fehlermeldungen an):

Warning: Invalid argument supplied for foreach() in system/modules/survey_ce/templates/survey_answers_multiplechoice.html5 on line 10
#0 system/modules/survey_ce/templates/survey_answers_multiplechoice.html5(10): __error(2, 'Invalid argumen...', '/var/www/client...', 10, Array)
#1 system/modules/core/library/Contao/Template.php(276): include('/var/www/client...')
#2 system/modules/core/classes/FrontendTemplate.php(37): Contao\Template->parse()
#3 system/modules/survey_ce/classes/ContentSurvey.php(507): Contao\FrontendTemplate->parse()
#4 system/modules/core/elements/ContentElement.php(159): Contao\ContentSurvey->compile()
#5 system/modules/survey_ce/classes/ContentSurvey.php(52): Contao\ContentElement->generate()
#6 system/modules/core/library/Contao/Controller.php(456): Contao\ContentSurvey->generate()
#7 system/modules/core/modules/ModuleArticle.php(205): Contao\Controller->getContentElement(Object(Contao\ContentModel), 'main')
#8 system/modules/core/modules/Module.php(148): Contao\ModuleArticle->compile()
#9 system/modules/core/modules/ModuleArticle.php(59): Contao\Module->generate()
#10 system/modules/core/library/Contao/Controller.php(392): Contao\ModuleArticle->generate(false)
#11 system/modules/core/library/Contao/Controller.php(254): Contao\Controller->getArticle(Object(Contao\ArticleModel), false, false, 'main')
#12 system/modules/core/pages/PageRegular.php(138): Contao\Controller->getFrontendModule('0', 'main')
#13 index.php(249): Contao\PageRegular->generate(Object(Contao\PageModel), true)
#14 index.php(433): Index->run()
#15 {main}

Contao Version 3.2.7, PHP-Version 5.5.9
gleiches bei Contao Version 3.5.30, PHP-Version 5.6.x

@hschottm
Copy link
Owner

Der Fehler tritt auf, wenn versucht wird, die "Choices" der Multiple Choice Frage auszugeben. Offenbar existieren diese aber nicht, was zu dem Fehler führt. Kann es sein, dass die betreffende Frage aus welchen Gründen auch immer unvollständig ist und nicht über Antworten verfügt?

Ich könnte im template lediglich eine Überprüfung integrieren, ob tatsächlich Antwortvorgaben existieren, aber die müssen eigentlich existieren, weswegen das eigentliche Problem mit einer Aktualisierung des Templates nicht behoben werden dürfte.

@cliffparnitzky
Copy link

Der Fehler hat sich mittlerweile geklärt.

Es wurden nicht nur die Antworten nicht gerendert, sondern die ganze Frage nicht. Auch nicht Titel und Beschreibung.

Am Ende war die Lösung recht simpel: in den Seiten der Umfrage darf man als Seitentemplate nur die "survey_questionblock..." verwenden.

Ggf. wäre es sinnvoll im DCA in dern Methode getSurveyTemplates (https://github.com/hschottm/survey_ce/blob/master/dca/tl_survey_page.php#L203) den Suffix entsprechend anzupassen.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants