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 2
2
3
3
namespace Drupal \patternkit ;
4
4
5
+ use Drupal \Component \Plugin \Exception \PluginNotFoundException ;
5
6
use Drupal \Component \Serialization \Exception \InvalidDataTypeException ;
6
7
use Drupal \Component \Utility \NestedArray ;
7
8
use Drupal \Core \Asset \Exception \InvalidLibrariesOverrideSpecificationException ;
@@ -440,11 +441,17 @@ protected function getLibraryMetadata(): array {
440
441
unset($ metadata [$ library_name ]['patterns ' ]);
441
442
}
442
443
foreach ($ pattern_libraries as $ info ) {
443
- $ plugin_id = $ info ['plugin ' ] ?? 'twig ' ;
444
- /** @var \Drupal\patternkit\PatternLibraryPluginInterface $plugin */
445
- $ plugin = $ this ->libraryPluginManager ->createInstance ($ plugin_id );
446
444
$ metadata [$ library_name ]['name ' ] = $ library_name ;
447
445
$ 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
+ }
448
455
/** @var \Drupal\patternkit\Pattern $pattern */
449
456
foreach ($ plugin ->getMetadata ($ extension , $ metadata [$ library_name ], $ info ['data ' ]) as $ pattern_path => $ pattern ) {
450
457
$ pattern ->setLibraryPluginId ($ plugin_id );
You can’t perform that action at this time.
0 commit comments