Closed (fixed)
Project:
Views AJAX History
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
3 Jun 2012 at 16:15 UTC
Updated:
29 Dec 2012 at 20:00 UTC
Jump to comment: Most recent file
Here is the setup:
I'm trying to find a way to exclude non-Views AJAX calls from Views AJAX History - even explicitly exclude the comments form ones - but this JS is a bit over my head. Any pointers?
Comments
Comment #1
nod_To fix this a check needs to be added somehow in
Drupal.ajax.prototype.beforeSerializeandDrupal.ajax.prototype.beforeSubmitto check that the ajax call was throught Views and not some other AJAX call on the page.Are you using custom code or a module to submit the comments with ajax?
(hopefully i'll have time tonight to see which checks can be made).
Comment #2
sokrplare commentedWow, you're fast! We are using custom code for the AJAX comments so I'll see if I can add it in there. No guarantees I'll be able to figure it out, but will do my best effort - thanks!
Comment #3
sokrplare commentedBrilliant!
I wrapped everything inside
Drupal.ajax.prototype.beforeSerializeandDrupal.ajax.prototype.beforeSubmitwith:if(options.url.substring(0, 11) == '/views/ajax') { ... }Another (better?) option would be checking against if
options.data.view_nameis set? It works for me so I'm content, but you'd know best what to check against for widest support.Comment #4
sokrplare commentedFor reference, here are screenshots of what the arguments from comment form AJAX submissions are.
Comment #5
nod_data.view_name does sounds like a good idea, do you have a patch laying around? :)
Comment #6
sokrplare commentedNope, but I sure can! Will attach it here in the next couple days.
Comment #7
nod_Awesome, thanks :)
Comment #8
sokrplare commentedMy patch files never seem to work, but hoping for the best here!
Comment #9
nod_Applied properly for me :)
A couple of things:
1) you need to leave
beforeSubmit.apply()andbeforeSerialize.apply()out of theif, because they need to run on every requests. Otherwise we'll break something else :)2) you can check with
if (option.data.view_name) {}it should be enough.Thanks a lot for actually providing the patch :)
Comment #10
sokrplare commentedNot working on the part of the project using this anymore, but wanted to get a patch file your way with these two changes made - haven't got to test this, but so long as you're right about the things you listed above, these are the only changes made, so should be good! Thanks, _nod.
Comment #11
sokrplare commentedHey nod_ I'm back doing a third migration to Drupal for the same client, any chance this patch will get committed? Thanks!
Comment #12
nod_Sorry that was actually applied on my local sandbox forgot to push and commit at the time. Fixed, thanks for the patch!
Comment #13
sokrplare commentedWoohoo!