fix(wp): load the Bricks BEM generator after the builder connector - #16
Merged
Conversation
The generator reads window.core_framework_connector once, at execution, and never retries. 2.0.0 moved that connector to the footer while the generator stayed in the head, so it read an undefined object, its gate failed, and the BEM icon never appeared in the structure panel. Declaring the dependency pins the order rather than relying on footer placement alone.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The bug
Auto BEM stopped appearing in the Bricks structure panel after updating to
2.0.0. Older versions are unaffected. The settings toggle still shows and the
script still ships, so nothing looks wrong until you hover an element.
bricks_bem_generator.jsreadswindow.core_framework_connectoronce, atexecution, and never retries.
43ab5899moved the connector to the footer byadding
$in_footer = true, while the generator stayed registered withfalse. The generator ran in the head, read an undefined object, its gatefailed, and it never initialised. The connector then appeared in the footer
with nothing left to read it.
It is the only connector-reading script still loading in the head, which is
why every other Bricks feature kept working.
The fix
Register the generator in the footer and declare the connector as a
dependency, so the order is pinned rather than left to placement.
Verification