Problem/Motivation
When a block is loaded asynchronously like a webform for example, the corresponding classes are not added and events are not bound, so the popup does not get triggered. The javascript file containing the logic does not make proper use of behaviors, thus it does not get attached when the block is loaded asynchronously.
Proposed resolution
Update the javascript file to make use of behaviors
Remaining tasks
Test and verify it works with other types of blocks.
| Comment | File | Size | Author |
|---|---|---|---|
| #5 | simple_popup_blocks-behaviors-fix-3146021-5.patch | 16.02 KB | ericmaster |
Comments
Comment #2
ericmaster commentedComment #3
eahonet commentedThank you for this @Ericmaster. This seemed to fix the symptoms my project had.
I have a with an id. That ID triggers a block to popup manually. That block is a search_api_saved_search block. It used to work. At some point, it started only working about 30% of the time. Just refreshing the page a few dozen times showed that sometimes it worked, but mostly it didn't. No consistency on when it would or wouldn't.
Using this patch, it's now working on every refresh.
However, the console output is a problem of the patch for me. I can't deploy this patch up to a production environment with debug info outputting. And in my case it's triggering ~35 times a page load.
Comment #4
ericmaster commentedRemoved debug info output, thanks for pointing that out.
Comment #5
ericmaster commentedDid not correctly generated previous patch, this one should work.
Comment #6
broonThank you for that patch, works like a charm and applies cleanly to version 1.2.
Comment #8
mattbloomfield commentedPatch applied to new D9-compatible 2.0 branch, version 2.1.
Comment #9
mattbloomfield commentedThanks, this has been committed.
Comment #10
mattbloomfield commented