Problem/Motivation
The lightbox_theme() hook in lightbox.module declares a theme hook named lightbox_formatter, which makes Drupal look for templates/lightbox-formatter.html.twig.
However, the template shipped with the module is named lightbox-image-formatter.html.twig (which corresponds to a lightbox_image_formatter theme hook). This mismatch causes a Twig loader error.
Steps to reproduce
- Install and enable the Lightbox module
- Configure an image field to use the Lightbox image formatter
- View a content entity with that field
The following error is thrown:
Twig\Error\LoaderError: Template "modules/contrib/lightbox/templates/lightbox-formatter.html.twig" is not defined in "field.html.twig" at line 75. in Twig\Loader\ChainLoader->getCacheKey() (line 75 of themes/contrib/bootstrap5/templates/field/field.html.twig)
Proposed resolution
Rename the template lightbox-image-formatter.html.twig to lightbox-formatter.html.twig to match the existing theme hook.
Issue fork lightbox-3577497
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
Comments
Comment #3
dpiet commentedComment #4
dpiet commentedComment #5
dpiet commentedComment #6
dpiet commentedComment #7
mably commentedComment #9
mably commented