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.

CommentFileSizeAuthor
#1 message-context-1249064-1.patch529 bytesBassistJimmyJam
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

BassistJimmyJam’s picture

Status: Active » Needs review
FileSize
529 bytes

Attached patch.

MasterChief’s picture

Status: Needs review » Needs work

Hi again BassistJimmyJam!

I applied the patch but he doesn't fix anything for the confirmation dialog option :(

Another idea ?

BassistJimmyJam’s picture

Status: Needs work » Needs review

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

MasterChief’s picture

Status: Needs review » Reviewed & tested by the community

I tested and it works like a charm :)

Berdir’s picture

Status: Reviewed & tested by the community » Fixed

Commited to all branches, thanks.

Status: Fixed » Closed (fixed)

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