Behaviour attach triggering twice At some point in an update in the last few months, Drupal (7) started routinely triggering attached behaviours twice.

At first I thought "this is my fault, my behaviours should check to see if they've been run in this context already", and I set about using jQuery's once() (and other such solutions).

However I'm convinced now that this is a wider problem. e.g. the admin_menu module generates 2 admin menus.

Has anyone found this and the cause of it and a solution (beyond patching every module in use to check for duplicate calls)? I'm not sure where to start looking!

Nb. I've said "drupal" is doing this, I suppose it could be a contrib module that's causing the behaviour. I've seen it across several sites (I manage a dozen or so)
I put a breakpoint on one script's attach behaviours and inspected the call stack both times it was called.

The first time was expected, from drupal.js, and the second turned out to be from a call in the EU Cookie Compliance module. This turned out to be a bug in the EU Cookie Compliance module.

Thanks for comments. I'll leave this here in case anyone else of the 70.5k users of that module experience the same issue!