File tree Expand file tree Collapse file tree 2 files changed +8
-9
lines changed
src/Plugin/PatternLibrary Expand file tree Collapse file tree 2 files changed +8
-9
lines changed Original file line number Diff line number Diff line change 66use Drupal \Core \Config \ConfigFactoryInterface ;
77use Drupal \Core \Plugin \ContainerFactoryPluginInterface ;
88use Drupal \Core \State \StateInterface ;
9+ use Drupal \patternkit \Annotation \PatternLibrary ;
910use Drupal \patternkit \JSONSchemaEditorTrait ;
1011use Drupal \patternkit \Pattern ;
1112use Drupal \patternkit \PatternEditorConfig ;
2425class PatternLibraryJSON extends PatternLibraryPluginDefault implements ContainerFactoryPluginInterface {
2526 use JSONSchemaEditorTrait;
2627
27- /**
28- * State machine service.
29- *
30- * @var \Drupal\Core\State\StateInterface
31- */
32- protected $ state ;
33-
3428 /**
3529 * Attaches services.
3630 *
Original file line number Diff line number Diff line change @@ -83,8 +83,13 @@ public function render(array $assets): array {
8383 $ bare = basename ($ file );
8484 /** @var \Drupal\Core\Template\TwigEnvironment $twig */
8585 $ twig = \Drupal::service ('twig ' );
86- $ template = $ twig ->load ("$ namespace/ $ pattern ->filename " );
87- $ elements [] = $ template ->render ($ pattern ->config ?? []);
86+ try {
87+ $ template = $ twig ->load ("$ namespace/ $ pattern ->filename " );
88+ $ elements [] = $ template ->render ($ pattern ->config ?? []);
89+ }
90+ catch (\Exception $ exception ) {
91+ // @todo Use twig logger and log this exception.
92+ }
8893 }
8994 return $ elements ;
9095 }
You can’t perform that action at this time.
0 commit comments