Skip to content

Commit

Permalink
Merge pull request #62 from aleevas/DS-1023
Browse files Browse the repository at this point in the history
fix: [DS-1023] Fix the function that skips attaching WS libraries for pages without LB .
  • Loading branch information
podarok authored Jan 23, 2024
2 parents 78ecf86 + 25a9141 commit ca6fd10
Showing 1 changed file with 8 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -52,9 +52,16 @@ function ws_home_branch_preprocess_block__lb_openy_map(&$variables) {

function _ws_home_branch_skip_override($node) {
// Skip page without node.
if (!$node instanceof NodeInterface) {
return TRUE;
}
// Skip nodes without LB usage.
if (!$node->hasField('layout_builder__layout')) {
return TRUE;
}
// Skip nodes with optional layout builder usage with deactivated usage.
if (!$node instanceof NodeInterface || !$node->hasField('layout_builder__layout') && $node->hasField('field_use_layout_builder') && !$node->field_use_layout_builder->value) {
if ($node->hasField('field_use_layout_builder')
&& !$node->field_use_layout_builder->value) {
return TRUE;
}
return FALSE;
Expand Down

0 comments on commit ca6fd10

Please sign in to comment.