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

Fix undefined array key warning when using an article list #4673

Merged
merged 2 commits into from May 17, 2022

Conversation

MarkejN
Copy link
Contributor

@MarkejN MarkejN commented May 13, 2022

When you use the Article List module, the following warning will occur under PHP 8:

ErrorException:
Warning: Undefined array key 0

  at vendor/contao/contao/core-bundle/src/Resources/contao/modules/ModuleArticleList.php:105
  at Contao\ModuleArticleList->compile()
     (vendor/contao/contao/core-bundle/src/Resources/contao/modules/Module.php:214)
  at Contao\Module->generate()
     (vendor/contao/contao/core-bundle/src/Resources/contao/modules/ModuleArticleList.php:45)
  at Contao\ModuleArticleList->generate()
     (vendor/contao/contao/core-bundle/src/Resources/contao/elements/ContentModule.php:98)
  at Contao\ContentModule->generate()
     (vendor/contao/contao/core-bundle/src/Resources/contao/library/Contao/Controller.php:615)
  at Contao\Controller::getContentElement()
     (vendor/contao/contao/core-bundle/src/Resources/contao/modules/ModuleArticle.php:197)
  at Contao\ModuleArticle->compile()
     (vendor/contao/contao/core-bundle/src/Resources/contao/modules/Module.php:214)
  at Contao\Module->generate()
     (vendor/contao/contao/core-bundle/src/Resources/contao/modules/ModuleArticle.php:70)
  at Contao\ModuleArticle->generate()
     (vendor/contao/contao/core-bundle/src/Resources/contao/library/Contao/Controller.php:543)
  at Contao\Controller::getArticle()
     (vendor/contao/contao/core-bundle/src/Resources/contao/library/Contao/Controller.php:385)
  at Contao\Controller::getFrontendModule()
     (vendor/contao/contao/core-bundle/src/Resources/contao/pages/PageRegular.php:190)
  at Contao\PageRegular->prepare()
     (vendor/contao/contao/core-bundle/src/Resources/contao/pages/PageRegular.php:60)
  at Contao\PageRegular->getResponse()
     (vendor/contao/contao/core-bundle/src/Resources/contao/controllers/FrontendIndex.php:316)
  at Contao\FrontendIndex->renderPage()
     (vendor/symfony/http-kernel/HttpKernel.php:152)
  at Symfony\Component\HttpKernel\HttpKernel->handleRaw()
     (vendor/symfony/http-kernel/HttpKernel.php:74)
  at Symfony\Component\HttpKernel\HttpKernel->handle()
     (vendor/symfony/http-kernel/Kernel.php:202)
  at Symfony\Component\HttpKernel\Kernel->handle()
     (web/index.php:44)  

fritzmg
fritzmg previously approved these changes May 13, 2022
aschempp
aschempp previously approved these changes May 14, 2022
@leofeyer leofeyer added the bug label May 14, 2022
@leofeyer leofeyer added this to the 4.13 milestone May 14, 2022
m-vo
m-vo previously approved these changes May 14, 2022
Co-authored-by: Martin Auswöger <martin@auswoeger.com>
@leofeyer leofeyer dismissed stale reviews from m-vo, aschempp, and fritzmg via 1d46c5e May 17, 2022 09:15
@leofeyer leofeyer enabled auto-merge (squash) May 17, 2022 09:17
@leofeyer
Copy link
Member

Thank you @MarkejN.

@leofeyer leofeyer merged commit 7b99005 into contao:4.13 May 17, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants