Unverified Commit 42d46132 authored by Lee Rowlands's avatar Lee Rowlands Committed by Lee Rowlands
Browse files

Issue #3258849 by larowlan: Disabled vocabularies are not filtered out

parent 6e1d5451
Loading
Loading
Loading
Loading
+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
+3 −1
Original line number Diff line number Diff line
@@ -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.
+4 −0
Original line number Diff line number Diff line
@@ -94,6 +94,10 @@ class LbDefaultBlocksLookupCommonTermsTest extends LbDefaultBlocksKernelTestBase
                'enabled' => TRUE,
                'weight' => 0,
              ],
              $vocab2->id() => [
                'enabled' => FALSE,
                'weight' => 0,
              ],
            ],
          ],
        ],