Skip to content

Commit

Permalink
Merge pull request #255 from aleevas/DS-1657
Browse files Browse the repository at this point in the history
feat: [DS-1657] Extend override libraries for WS override plugin
  • Loading branch information
podarok authored Nov 12, 2024
2 parents ae385db + 629a9a5 commit 5a43dea
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/WSOverrideLayoutBuilder.php
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ private function getSelectedColorway(EntityInterface $entity): string {
$stored_ws_styles = $entity?->override_styles?->value
? unserialize($entity?->styles?->value)
: $this->getDefaultWsStyle($entity->bundle());
return $stored_ws_styles['colorway'];
return $stored_ws_styles['colorway'] ?? '';
}

/**
Expand Down
4 changes: 4 additions & 0 deletions y_lb.module
Original file line number Diff line number Diff line change
Expand Up @@ -261,6 +261,10 @@ function y_lb_preprocess_block(&$variables) {
// Override library via override plugin.
if ($libraries = _y_lb_get_override_component_library($variables['plugin_id'])) {
$variables['#attached']['library'] = $libraries;
// In case custom block with add library in the content area.
if (isset($variables['content']['#attached'])) {
$variables['content']['#attached']['library'][] = $libraries[0];
}
}
}

Expand Down

0 comments on commit 5a43dea

Please # to comment.