contao / contao

Contao Open Source CMS
https://contao.org
GNU Lesser General Public License v3.0
350 stars 159 forks source link

FAQ Image not work #2786

Closed jonnysp closed 3 years ago

jonnysp commented 3 years ago

After updating to 4.11, the images in the faq entries do not work.

[2021-02-22T10:51:49.321582+01:00] request.CRITICAL: Uncaught PHP Exception Symfony\Component\ErrorHandler\Error\UndefinedMethodError: "Attempted to call an undefined method named "getOverwriteMetadata" of class "Contao\Model\Collection"." at C:\xampp\htdocs\contao4\vendor\contao\faq-bundle\src\Resources\contao\modules\ModuleFaqPage.php line 110 {"exception":"[object] (Symfony\Component\ErrorHandler\Error\UndefinedMethodError(code: 0): Attempted to call an undefined method named \"getOverwriteMetadata\" of class \"Contao\Model\Collection\". at C:\xampp\htdocs\contao4\vendor\contao\faq-bundle\src\Resources\contao\modules\ModuleFaqPage.php:110)"} []

qzminski commented 3 years ago

It's caused by #2072 and happens at https://github.com/contao/contao/blob/4.x/faq-bundle/src/Resources/contao/modules/ModuleFaqPage.php#L110. Instead, the code should probably be

->setMetadata($objFaq->current()->getOverwriteMetadata())

/cc @m-vo

m-vo commented 3 years ago

Hmm, how do I reproduce this? In my demo, images are showing just fine for FAQ entries.

m-vo commented 3 years ago

Nevermind, I got it.

m-vo commented 3 years ago

see #2788