Fehler beim Nichtausfüllen eines RSCE
Hallo,
ich habe ein merkwürdiges Verhalten bei einem RSCE.
Vorab, das Inhaltselement funktioniert einwandfrei, wenn ich alle Felder ausfülle.
Wenn ich allerdings das Element wähle und nichts ausfülle, sondern über den Zurück-Link wieder zur Übersicht gehe, erhalte ich eine Fehlermeldung im Browser.
PHP-Code:
An exception has been thrown during the rendering of a template ("Contao\CoreBundle\Twig\Runtime\FigureRuntime::buildFigure(): Argument #1 ($from) must be of type Contao\FilesModel|Contao\Image\ImageInterface|string|int, null given, called in /.../var/cache/prod/twig/21/21bf61f705996038be3373b14e7797d8.php on line 95").
Ich kann die Inhaltselemente dieser Seite anschließend nicht mehr bearbeiten, im Log steht:
PHP-Code:
[2024-09-16T10:58:15.899440+02:00] request.INFO: Matched route "contao_backend". {"route":"contao_backend","route_parameters":{"_route":"contao_backend","_scope":"backend","_controller":"Contao\\CoreBundle\\Controller\\BackendController::mainAction"},"request_uri":"https://domain.de/contao?do=article&id=5&ref=nLNpvI2Z&rt=a319e2b978c58eb.jtn9aRACg0ZxfFHP3iJexmwo7zGFZizsrpkxXw2HWX8.3ei-BVpF2zc6GhW_lhEIilpplUHOFlykyt9uMm7uAUvMsMU_IETZFUYwBA&table=tl_content","method":"GET"} {"request_uri":"https://domain.de/contao?do=article&id=5&ref=nLNpvI2Z&rt=a319e2b978c58eb.jtn9aRACg0ZxfFHP3iJexmwo7zGFZizsrpkxXw2HWX8.3ei-BVpF2zc6GhW_lhEIilpplUHOFlykyt9uMm7uAUvMsMU_IETZFUYwBA&table=tl_content","request_method":"GET"}
[2024-09-16T10:58:15.978945+02:00] request.CRITICAL: Uncaught PHP Exception Twig\Error\RuntimeError: "An exception has been thrown during the rendering of a template ("Contao\CoreBundle\Twig\Runtime\FigureRuntime::buildFigure(): Argument #1 ($from) must be of type Contao\FilesModel|Contao\Image\ImageInterface|string|int, null given, called in /home2/www/daikunlab/_md/.../var/cache/prod/twig/21/21bf61f705996038be3373b14e7797d8.php on line 95")." at rsce_img-text-box.html.twig line 14 {"exception":"[object] (Twig\\Error\\RuntimeError(code: 0): An exception has been thrown during the rendering of a template (\"Contao\\CoreBundle\\Twig\\Runtime\\FigureRuntime::buildFigure(): Argument #1 ($from) must be of type Contao\\FilesModel|Contao\\Image\\ImageInterface|string|int, null given, called in /home2/www/daikunlab/_md/.../var/cache/prod/twig/21/21bf61f705996038be3373b14e7797d8.php on line 95\"). at /home2/www/daikunlab/_md/.../templates/rsce_img-text-box.html.twig:14)\n[previous exception] [object] (TypeError(code: 0): Contao\\CoreBundle\\Twig\\Runtime\\FigureRuntime::buildFigure(): Argument #1 ($from) must be of type Contao\\FilesModel|Contao\\Image\\ImageInterface|string|int, null given, called in /home2/www/daikunlab/_md/.../var/cache/prod/twig/21/21bf61f705996038be3373b14e7797d8.php on line 95 at /home2/www/daikunlab/_md/.../vendor/contao/core-bundle/src/Twig/Runtime/FigureRuntime.php:63)"} {"request_uri":"https://domain.de/contao?do=article&id=5&ref=nLNpvI2Z&rt=a319e2b978c58eb.jtn9aRACg0ZxfFHP3iJexmwo7zGFZizsrpkxXw2HWX8.3ei-BVpF2zc6GhW_lhEIilpplUHOFlykyt9uMm7uAUvMsMU_IETZFUYwBA&table=tl_content","request_method":"GET"}
[2024-09-16T10:58:16.002235+02:00] messenger.INFO: Stopping worker. {"transport_names":["contao_prio_high"]} {"request_uri":"https://domain.de/contao?do=article&id=5&ref=nLNpvI2Z&rt=a319e2b978c58eb.jtn9aRACg0ZxfFHP3iJexmwo7zGFZizsrpkxXw2HWX8.3ei-BVpF2zc6GhW_lhEIilpplUHOFlykyt9uMm7uAUvMsMU_IETZFUYwBA&table=tl_content","request_method":"GET"}
Folgende Zeile in meinem RSCE ist vermutlich dafür verantwortlich (eine Bildgröße für 1 ist definiert):
PHP-Code:
<div class="ce-textimage-box--img" style="background-image:url({{ figure(image,1).image.img.src }})"></div>
Wenn ich diese Zeile lösche kann ich das Inhaltselement wieder bearbeiten.
Wo kann da der Fehler liegen?
Gruß Michael
Contao 5.3.14