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.

Comments

Ericmaster created an issue. See original summary.

ericmaster’s picture

Status: Active » Needs review
eahonet’s picture

Thank 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.

ericmaster’s picture

StatusFileSize
new16.02 KB

Removed debug info output, thanks for pointing that out.

ericmaster’s picture

StatusFileSize
new16.02 KB

Did not correctly generated previous patch, this one should work.

broon’s picture

Status: Needs review » Reviewed & tested by the community

Thank you for that patch, works like a charm and applies cleanly to version 1.2.

  • mattbloomfield committed 3c3238b on 8.x-2.x
    'Issue #3146021 by Ericmaster: Does not work with blocks that are loaded...
mattbloomfield’s picture

Patch applied to new D9-compatible 2.0 branch, version 2.1.

mattbloomfield’s picture

Thanks, this has been committed.

mattbloomfield’s picture

Status: Reviewed & tested by the community » Fixed

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.