Hi there,

the attached patch solves a problem which occurs with ajax paging of views when the same view is represented more than once in Drupal.settings.views.ajaxViews. I know this is a rare occurrence but it happens with the new ajax version of my Quick Tabs module (the 6.x-2.x branch) because you can have two tabs, each containing an instance of the same view but with different arguments. You can see an example of what I mean here.

The patch simply puts a conditional around the line where the viewData variable (which will be the parameters sent with the ajax call to fetch the view) is populated from the settings - so that this only happens when the information about the view has not been retrieved from the querystring. Without the patch, the pager links on the second instance of the view, though their href contains the right data, result in the view being retrieved based on the settings for the first instance of that view_name within Drupal.settings.views.ajaxViews - which in the case of my example has different view_args.

I hope my explanation makes sense. I've tested ajax paged and filtered views outside of Quick Tabs with the patch and have noticed no side effects.




merlinofchaos’s picture

Status:Needs review» Fixed

Looks ok. Committed.

katbailey’s picture

Status:Fixed» Active
new855 bytes

Sorry - I had forgotten about the table sort links, which needed the same treatment. Attached patch does the exact same thing a few lines down...

Pasqualle’s picture

Status:Active» Reviewed & tested by the community

this patch works. there is a remaining problem with exposed filters
the related issue: #345525: problems with ajax views inside ajax quicktabs (pagination)

merlinofchaos’s picture

Status:Reviewed & tested by the community» Needs work

Hmm, patch fails to apply. I think Nedjo's ajax fixes I committed earlier may have interfered with this.

katbailey’s picture

Ah yes, Nedjo's changes do indeed conflict with this. Ok, I'll need to re-think how to do this, maybe even discuss it with Nedjo to see if we can come up with a general solution for loading Views via ajax.

katbailey’s picture

Status:Needs work» Fixed

Woah - actually I think Nedjo's changes eliminate the need for any patch from me. I thought it conflicted at first because some weird stuff was happening (behaviours not getting attached) but I think it must have been just a caching thing, and possibly I hadn't updated all the files. Have since tested with views HEAD and it's all working very smoothly indeed. Go Nedjo!! :-)

Status:Fixed» Closed (fixed)

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

x_tra06’s picture

this path not working on the views 2.16 version? fix please?