File tree Expand file tree Collapse file tree 1 file changed +10
-3
lines changed
Expand file tree Collapse file tree 1 file changed +10
-3
lines changed Original file line number Diff line number Diff line change 22
33namespace Drupal \patternkit ;
44
5+ use Drupal \Component \Plugin \Exception \PluginNotFoundException ;
56use Drupal \Component \Serialization \Exception \InvalidDataTypeException ;
67use Drupal \Component \Utility \NestedArray ;
78use Drupal \Core \Asset \Exception \InvalidLibrariesOverrideSpecificationException ;
@@ -440,11 +441,17 @@ protected function getLibraryMetadata(): array {
440441 unset($ metadata [$ library_name ]['patterns ' ]);
441442 }
442443 foreach ($ pattern_libraries as $ info ) {
443- $ plugin_id = $ info ['plugin ' ] ?? 'twig ' ;
444- /** @var \Drupal\patternkit\PatternLibraryPluginInterface $plugin */
445- $ plugin = $ this ->libraryPluginManager ->createInstance ($ plugin_id );
446444 $ metadata [$ library_name ]['name ' ] = $ library_name ;
447445 $ metadata [$ library_name ] += $ info ;
446+ $ plugin_id = $ info ['plugin ' ] ?? 'twig ' ;
447+ /** @var \Drupal\patternkit\PatternLibraryPluginInterface $plugin */
448+ try {
449+ $ plugin = $ this ->libraryPluginManager ->createInstance ($ plugin_id );
450+ }
451+ catch (PluginNotFoundException $ exception ) {
452+ \Drupal::logger ('patternkit ' )->error ('Error loading pattern libraries: @message ' , ['@message ' => $ exception ->getMessage ()]);
453+ continue ;
454+ }
448455 /** @var \Drupal\patternkit\Pattern $pattern */
449456 foreach ($ plugin ->getMetadata ($ extension , $ metadata [$ library_name ], $ info ['data ' ]) as $ pattern_path => $ pattern ) {
450457 $ pattern ->setLibraryPluginId ($ plugin_id );
You can’t perform that action at this time.
0 commit comments