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.
I found a possible bug in ajaxView. ajaxView function will always create ajax object when attachBehaviors is triggered. This causes multiple ajax requests when RefreshView event is triggered. Here is the patch which should fix that.
Comment | File | Size | Author |
---|---|---|---|
#13 | views-refresh_multiple_ajax_calls-2415027-13.patch | 621 bytes | sam.spinoy@gmail.com |
|
Comments
Comment #1
n_vashenko CreditAttribution: n_vashenko commentedComment #2
lklimek CreditAttribution: lklimek at Software Inn commentedI also have this issue, reproduced on clean drupal install.
Repro scenario:
1. install Drupal 7 + Views 3.11
2. create an ajax-enabled view 'test' and some content to display in this view
3. go to the view page and execute in JS console Drupal.attachBehaviors, for example: Drupal.attachBehaviors(jQuery('#header'))
4. inspect div containing your view (the one with class "view"): it now contains 2 jQuery event handlers attached to RefreshView event
5. repeat point 3 several times and notice that number of RefreshView handlers is increasing with every attachBehaviors() call
The patch #1 fixes the issue for me.
Comment #4
dave.erwin CreditAttribution: dave.erwin commentedthanks for the patch, this issue was driving me crazy.
resubmitting patch for testing.
Comment #5
dave.erwin CreditAttribution: dave.erwin commentedactually, I did some testing and was getting the error:
Uncaught TypeError: self.setInterval is not a function
when using the sharethis service, I changed
self = this;
to
var self = this;
to clear up the error
Comment #6
KarlSheaFixed my issue.
Comment #7
KarlSheaComment #8
KarlSheaSorry for the spam, forgot to update version
Comment #9
maximpodorov CreditAttribution: maximpodorov commentedThe patch is renamed to include the issue number.
Comment #10
dsutter CreditAttribution: dsutter as a volunteer commentedRTBC+ patch #9
Comment #11
gdaw CreditAttribution: gdaw as a volunteer commentedConfirmed RTBC+1 for patch #9
Comment #12
KarlSheaReroll
Comment #13
sam.spinoy@gmail.com CreditAttribution: sam.spinoy@gmail.com at Adapt commentedReroll for latest release
Comment #14
apadernoComment #15
DamienMcKennaComment #17
DamienMcKennaCommitted. Thanks!