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.
The statistics module overwrites #attached, wiping out existing values set by other modules, if it happens to run after them. It should not do that, but keep the existing array intact.
Comment | File | Size | Author |
---|---|---|---|
#7 | statistics_node_view-overwrites-attached-js-2470525-7.patch | 1.08 KB | osman |
#5 | statistics_node_view-overwrites-attached-js-2470525-5.patch | 1.04 KB | osman |
#3 | statistics-keep-attached-2470525-3.patch | 724 bytes | berenddeboer |
Comments
Comment #1
berenddeboer CreditAttribution: berenddeboer commentedComment #3
berenddeboer CreditAttribution: berenddeboer commentedComment #5
osmanI confirm the issue.
Enabling Statistics.module overrides existing
$node->content['#attached']['js']
array content.Thanks berenddeboer for reporting it.
Comment #6
osmanComment #7
osmanSeems like this issue is Drupal 7.x only. 8.x is not affected.
Attached patch is formatted better to comply with coding standards.
Comment #8
timmillwoodComment #9
David_Rothstein CreditAttribution: David_Rothstein as a volunteer commentedCommitted to 7.x - thanks!
Sigh, I remember that I discovered this exact same issue when reviewing the original patch (#1209532-181: Count node views via AJAX in the statistics module), but I missed that it was not addressed before I committed the final version...