Skip to content

fix: master Enabled toggle not disabling PageBuilder preload scan#6

Merged
SamJUK merged 1 commit into
masterfrom
fix/blocktohtmlafter-master-enabled-toggle
Jul 15, 2026
Merged

fix: master Enabled toggle not disabling PageBuilder preload scan#6
SamJUK merged 1 commit into
masterfrom
fix/blocktohtmlafter-master-enabled-toggle

Conversation

@SamJUK

@SamJUK SamJUK commented Jul 15, 2026

Copy link
Copy Markdown
Owner

Summary

BlockToHtmlAfter::execute() used && instead of ||:

if (!$this->config->isEnabled() && !$this->config->isPageBuilderPreloadEnabled()) {
    return;
}

This only skips when both flags are false — so setting the master
samjuk_fetch_priority/general/enabled toggle to No does nothing as
long as preloads/pagebuilder_content (default: Yes) is still on.
Every other observer in the module correctly uses || (master switch
gates everything).

Test plan

  • Updated the two unit tests that had encoded the buggy truth table
    (testExecutesWhenOnlyModuleEnabled /
    testExecutesWhenOnlyPageBuilderPreloadEnabled) to assert the
    correct behaviour instead.
  • Full Test/Unit/Observer/View/BlockToHtmlAfterTest.php suite passes
    (8/8) against Magento 2.4.8-p3/PHP 8.3.

BlockToHtmlAfter used && instead of || when checking the two config
flags, so it only skipped when BOTH isEnabled() and
isPageBuilderPreloadEnabled() were false. Turning the module's master
"Enabled" switch off had no effect as long as the (default-on)
pagebuilder_content toggle was left enabled — every other observer in
the module already uses the correct || guard.
@SamJUK
SamJUK merged commit b618f45 into master Jul 15, 2026
12 checks passed
@SamJUK
SamJUK deleted the fix/blocktohtmlafter-master-enabled-toggle branch July 15, 2026 21:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant