Problem/Motivation

While using Patterns in views, getting error for the selected component/pattern

Twig\Error\LoaderError: Template "@organisms/card-carousel/_icon-card-carousel.twig" is not defined in "modules/contrib/ui_patterns/templates/patterns-use-wrapper.html.twig" at line 9. in Twig\Loader\ChainLoader->getCacheKey() (line 9 of /var/www/html/docroot/modules/contrib/ui_patterns/templates/patterns-use-wrapper.html.twig).

The name of the template in the error will change according to the chosen pattern/component in the Pattern.

Steps to reproduce

1. Create a view
2. Choose Format and Style as Pattern
3. Choose Pattern in the settings
4. Check the console and error logs

Proposed resolution

Remaining tasks

User interface changes

API changes

Data model changes

Command icon 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

prashant.c created an issue. See original summary.

prashant.c’s picture

StatusFileSize
new428 bytes

Submitting patch to fix the error.

pdureau’s picture

Status: Active » Needs work

Thanks a lot Prashant. Can you do a MR instead of a patch?

pdureau’s picture

Title: Views Preview: Twig\Error\LoaderError: Template is not defined in "modules/contrib/ui_patterns/templates/patterns-use-wrapper.html.twig" at line 9. in Twig\Loader\ChainLoader->getCacheKey() » Views preview: Template is not defined in "patterns-use-wrapper.html.twig"

Views preview: Template is not defined in "patterns-use-wrapper.html.twig"

pdureau’s picture

I am not familiar with the use wrapper system in UI Patterns 1.x. Are you sure the fix needs to be in the Twig template? There is nothing we can do earlier, at PHP level?

prabha1997 made their first commit to this issue’s fork.

prabha1997’s picture

@pdureau
we are getting this issue when ever view preview is enabled in views
view preview

An AJAX HTTP error occurred.
HTTP Result Code: 500
Debugging information follows.
Path: /admin/structure/views/view/test_view/preview/page_1
StatusText: error
ResponseText: The website encountered an unexpected error. Try again later.Twig\Error\LoaderError: Template "@organisms/accordion/accordion.twig" is not defined in "modules/contrib/ui_patterns/templates/patterns-use-wrapper.html.twig" at line 9. in Twig\Loader\ChainLoader->getCacheKey() (line 99 of /var/www/html/vendor/twig/twig/src/Loader/ChainLoader.php). Twig\Environment->getTemplateClass('@organisms/accordion/accordion.twig', NULL) (Line: 204)
Drupal\Core\Template\TwigEnvironment->getTemplateClass('@organisms/accordion/accordion.twig') (Line: 279)
Twig\Template->loadTemplate('@organisms/accordion/accordion.twig', 'modules/contrib/ui_patterns/templates/patterns-use-wrapper.html.twig', 9) (Line: 40)

After adding the above patch changes issue has been resolved

prabha1997’s picture

Assigned: Unassigned » prabha1997
Status: Needs work » Needs review
prabha1997’s picture

I suggest we have to show this warning message
Pattern Views row plugin does not support preview.
instead of error

prabha1997’s picture

Assigned: prabha1997 » Unassigned