the image plugin does not exist.
original issue: https://github.com/nuvoleweb/ui_patterns/issues/175
I raised issue nearly a year ago with error on images. the reply suggested i read the documentation which is not helpful in this case. i have only installed and tried to use the module and made no code modifications. The documentation and it doesnt say a lot about images or plugins.
i am again trying to create a basic card (see comments below for yml and twig) with an image and i am seeing the following error:
The website encountered an unexpected error. Please try again later.</br></br><em class="placeholder">Drupal\Component\Plugin\Exception\PluginNotFoundException</em>: The "image" plugin does not exist. in <em class="placeholder">Drupal\Core\Plugin\DefaultPluginManager->doGetDefinition()</em> (line <em class="placeholder">52</em> of <em class="placeholder">core/lib/Drupal/Component/Plugin/Discovery/DiscoveryTrait.php</em>). <pre class="backtrace">Drupal\Core\Plugin\DefaultPluginManager->getDefinition('image') (Line: 42)
Drupal\ui_patterns\UiPatterns::getPatternDefinition('image') (Line: 45)
Drupal\ui_patterns\Element\Pattern::processRenderArray(Array)
call_user_func(Array, Array) (Line: 378)
Drupal\Core\Render\Renderer->doRender(Array, ) (Line: 195)
Drupal\Core\Render\Renderer->render(Array) (Line: 490)
Drupal\Core\Template\TwigExtension->escapeFilter(Object, Array, 'html', NULL, 1) (Line: 56)
__TwigTemplate_38111dc264ce6b284afebb7d527d2a2ce27c07a05bc3e2c02fbd6d34fbb0fa90->doDisplay(Array, Array) (Line: 432)
Twig_Template->displayWithErrorHandling(Array, Array) (Line: 403)
Twig_Template->display(Array) (Line: 411)
Twig_Template->render(Array) (Line: 64)
twig_render_template('modules/custom/custom_styles/templates/pattern-slidecard.html.twig', Array) (Line: 384)
Drupal\Core\Theme\ThemeManager->render('pattern_slidecard', Array) (Line: 437)
Drupal\Core\Render\Renderer->doRender(Array) (Line: 450)
Drupal\Core\Render\Renderer->doRender(Array) (Line: 450)
Drupal\Core\Render\Renderer->doRender(Array, ) (Line: 195)
Drupal\Core\Render\Renderer->render(Array) (Line: 490)
Drupal\Core\Template\TwigExtension->escapeFilter(Object, Array, 'html', NULL, 1) (Line: 109)
__TwigTemplate_651857238e63f207355f4c8ccf8dd57b07aed2371934c4913ba97cef2fd8c02c->doDisplay(Array, Array) (Line: 432)
Twig_Template->displayWithErrorHandling(Array, Array) (Line: 403)
Twig_Template->display(Array) (Line: 411)
Twig_Template->render(Array) (Line: 64)
twig_render_template('modules/contrib/ui_patterns/modules/ui_patterns_library/templates/patterns-overview-page.html.twig', Array) (Line: 384)
Drupal\Core\Theme\ThemeManager->render('patterns_overview_page', Array) (Line: 437)
Drupal\Core\Render\Renderer->doRender(Array, ) (Line: 195)
Drupal\Core\Render\Renderer->render(Array, ) (Line: 226)
Drupal\Core\Render\MainContent\HtmlRenderer->Drupal\Core\Render\MainContent\{closure}() (Line: 582)
Drupal\Core\Render\Renderer->executeInRenderContext(Object, Object) (Line: 227)
Drupal\Core\Render\MainContent\HtmlRenderer->prepare(Array, Object, Object) (Line: 117)
Drupal\Core\Render\MainContent\HtmlRenderer->renderResponse(Array, Object, Object) (Line: 90)
Drupal\Core\EventSubscriber\MainContentViewSubscriber->onViewRenderArray(Object, 'kernel.view', Object)
call_user_func(Array, Object, 'kernel.view', Object) (Line: 111)
Drupal\Component\EventDispatcher\ContainerAwareEventDispatcher->dispatch('kernel.view', Object) (Line: 156)
Symfony\Component\HttpKernel\HttpKernel->handleRaw(Object, 1) (Line: 68)
Symfony\Component\HttpKernel\HttpKernel->handle(Object, 1, 1) (Line: 57)
Drupal\Core\StackMiddleware\Session->handle(Object, 1, 1) (Line: 47)
Drupal\Core\StackMiddleware\KernelPreHandle->handle(Object, 1, 1) (Line: 99)
Drupal\page_cache\StackMiddleware\PageCache->pass(Object, 1, 1) (Line: 78)
Drupal\page_cache\StackMiddleware\PageCache->handle(Object, 1, 1) (Line: 47)
Drupal\Core\StackMiddleware\ReverseProxyMiddleware->handle(Object, 1, 1) (Line: 52)
Drupal\Core\StackMiddleware\NegotiationMiddleware->handle(Object, 1, 1) (Line: 23)
Stack\StackedHttpKernel->handle(Object, 1, 1) (Line: 669)
Drupal\Core\DrupalKernel->handle(Object) (Line: 19)
</pre>
and watchdog message:
php
Thursday, January 24, 2019 - 17:21
user1
http://www.syntapse.co.uk/patterns
Drupal\Component\Plugin\Exception\PluginNotFoundException: The "image" plugin does not exist. in Drupal\Core\Plugin\DefaultPluginManager->doGetDefinition() (line 52 of /var/www/html/web/core/lib/Drupal/Component/Plugin/Discovery/DiscoveryTrait.php).
Error
172.28.2.1
ui_patterns.yml looks like this:
slidecard:
label: 'Card'
description: 'A slide-card component.'
fields:
image:
label: 'Image'
description: 'A simple image with caption.'
fields:
image:
type: 'image'
label: 'Image'
description: 'background image'
preview:
theme: 'image'
uri: 'http://site/sites/default/files/2019-01/tech%20type%20font%20idea_1.png'
title:
type: 'text'
label: 'Title'
description: 'Set card title.'
preview: 'Card title'
position:
type: 'text'
label: 'Position'
description: 'Set overlay entrance position (top, bottom, left, right, fade)'
preview: 'left'
text:
type: 'text'
label: 'Text'
description: 'Card text.'
preview: 'Cras justo odio, dapibus ac facilisis in, egestas eget quam. Donec id elit non mi porta gravida at eget metus. Nullam id dolor id nibh ultricies vehicula ut id elit.'
``
pattern-slidecard.html.twig like this:
title = {{ title }} text = {{ text }} position = {{ position }} image = {{ image }}
Have you tried removing your single quotes? AFAIK the 'type' is simply used for documentation right now, so it's probably to do with your yml structure. There's definitely no single quotes in any of the examples.
The indentation of your ui_patterns.yml file seems to suggest that you have two patterns: slidecard and image, do you have the related twig template for both of them?