I have a Views panel pane display with Use Panel path set to Yes and Ajax enabled. My view also has a contextual filter for "Content: Has taxonomy term ID".
The view pane is used on the taxonomy/term/% taxonomy_term panel page. The view works fine and you can use the pager link exactly once. After that the view will return no results even if there are more results.
It appears that what is happening is that initially Drupal.settings.views.ajaxViews['view_dom_id:' . $dom_id].view_base_path is set to the internal path taxonomy/term/153 and Drupal.settings.views.ajaxViews['view_dom_id:' . $dom_id].view_args is set to the term id 153. Once you hit the ajax pager, these change and are incorrectly set for the next ajax call. IE: Drupal.settings.views.ajaxViews['view_dom_id:' . $dom_id].view_base_path becomes tag/fashion and Drupal.settings.views.ajaxViews['view_dom_id:' . $dom_id].view_args is set to the term name fashion
I found a few issues that may be related, but they all seem older and are mostly marked as resolved.
#636988: AJAX Pagers Can Send The Wrong view_args
| Comment | File | Size | Author |
|---|---|---|---|
| #7 | views-views_ajax_pager_sends_wrong_arguments-2603262-7.patch | 1.16 KB | andrew answer |
| #4 | views_ajax_pager_sends-2603262-4.patch | 1.26 KB | drewfranz |
| #2 | views_ajax_pager_sends-2603262-2.patch | 1.36 KB | jojonaloha |
Comments
Comment #2
jojonaloha commentedThe attached patch attempts to resolve this by using the
view_base_pathfrom the first call and using it to set$view->override_pathinviews_ajax(). The reason is that when called from view_ajax(),template_preprocess_views_view()calls$view->get_path()and the Panel pane display plugin does not have the panel path to do properly override it.Comment #3
drewfranz commentedThis patch fixed the issue for me as well.
Comment #4
drewfranz commentedPatch for Panopoly version of Views.Comment #5
drewfranz commentedComment #6
chris matthews commentedThe 3 year old patch in #2 to ajax.inc does not apply to the latest views 7.x-3.x-dev.
Comment #7
andrew answer commentedPatch rerolled.
Comment #8
cor73x commentedThis patch from #7 fixed issue also for me.
I have checked current 7x-3.23 and issue was still there.
Before path both view_args and view_path contains url alias instead term id and taxonomy/term/tid.