Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Currently, Drupal.attachBehaviors() is called whenever a new message is added, but with no context. This causes the context to default to the document. Any modules that rely on the context to bind events to elements on the page will cause the event to be bound for each message, as seen in button_field #825516: Confirmation Dialog Option. Instead, Drupal.attachBehaviors() should be called with the context of the message being added.
Comment | File | Size | Author |
---|---|---|---|
#1 | message-context-1249064-1.patch | 529 bytes | BassistJimmyJam |
Comments
Comment #1
BassistJimmyJam CreditAttribution: BassistJimmyJam commentedAttached patch.
Comment #2
MasterChief CreditAttribution: MasterChief commentedHi again BassistJimmyJam!
I applied the patch but he doesn't fix anything for the confirmation dialog option :(
Another idea ?
Comment #3
BassistJimmyJam CreditAttribution: BassistJimmyJam commented@MasterChief, there was an issue with button_field module that was related to this, though this patch still needs to be applied. Please see issue #1249378: jQuery selector for click event does not include context and update to the latest dev version of button_field-1.x.
Comment #4
MasterChief CreditAttribution: MasterChief commentedI tested and it works like a charm :)
Comment #5
BerdirCommited to all branches, thanks.