Loading modules/lb_default_blocks_common_terms/lb_default_blocks_common_terms.info.yml +1 −1 Original line number Diff line number Diff line name: Layoub Builder Default Blocks - Common Terms name: Layout Builder Default Blocks - Common Terms description: 'Defines a layout-builder default block matcher to match blocks based on common terms' core_version_requirement: ^8.8 || ~9.0 type: module Loading modules/lb_default_blocks_common_terms/src/Plugin/lb_default_blocks/Filter/CommonTerms.php +3 −1 Original line number Diff line number Diff line Loading @@ -215,7 +215,9 @@ class CommonTerms extends DefaultBlockFilterBase { $vocabularies = $this->configuration['settings']['vocabularies']; $weights = array_map(function (array $item) { return $item['weight']; }, $vocabularies); }, array_filter($vocabularies, function (array $item) { return !empty($item['enabled']); })); if ($vocabularies && $results && $matches = $this->backFillTerms->findMatchingEntitiesByTerms($contentEntity, 'block_content', [], 1, $weights, BackFillTerms::MODE_MATCH_ALL, [], function (SelectInterface $query) use ($results) { // This will also limit target bundles if the block_type filter is // enabled for this position. Loading modules/lb_default_blocks_common_terms/tests/src/Kernel/LbDefaultBlocksLookupCommonTermsTest.php +4 −0 Original line number Diff line number Diff line Loading @@ -94,6 +94,10 @@ class LbDefaultBlocksLookupCommonTermsTest extends LbDefaultBlocksKernelTestBase 'enabled' => TRUE, 'weight' => 0, ], $vocab2->id() => [ 'enabled' => FALSE, 'weight' => 0, ], ], ], ], Loading Loading
modules/lb_default_blocks_common_terms/lb_default_blocks_common_terms.info.yml +1 −1 Original line number Diff line number Diff line name: Layoub Builder Default Blocks - Common Terms name: Layout Builder Default Blocks - Common Terms description: 'Defines a layout-builder default block matcher to match blocks based on common terms' core_version_requirement: ^8.8 || ~9.0 type: module Loading
modules/lb_default_blocks_common_terms/src/Plugin/lb_default_blocks/Filter/CommonTerms.php +3 −1 Original line number Diff line number Diff line Loading @@ -215,7 +215,9 @@ class CommonTerms extends DefaultBlockFilterBase { $vocabularies = $this->configuration['settings']['vocabularies']; $weights = array_map(function (array $item) { return $item['weight']; }, $vocabularies); }, array_filter($vocabularies, function (array $item) { return !empty($item['enabled']); })); if ($vocabularies && $results && $matches = $this->backFillTerms->findMatchingEntitiesByTerms($contentEntity, 'block_content', [], 1, $weights, BackFillTerms::MODE_MATCH_ALL, [], function (SelectInterface $query) use ($results) { // This will also limit target bundles if the block_type filter is // enabled for this position. Loading
modules/lb_default_blocks_common_terms/tests/src/Kernel/LbDefaultBlocksLookupCommonTermsTest.php +4 −0 Original line number Diff line number Diff line Loading @@ -94,6 +94,10 @@ class LbDefaultBlocksLookupCommonTermsTest extends LbDefaultBlocksKernelTestBase 'enabled' => TRUE, 'weight' => 0, ], $vocab2->id() => [ 'enabled' => FALSE, 'weight' => 0, ], ], ], ], Loading