With the latest code in the 2.x branch the View is not properly forced to use ajax.

The only way I have been able to make the module work is configuring the view to use ajax.

The code in the module to force the view to use ajax doesn't seem to work. When I try to use the pager or the filter in the view I get a big dump of json.

CommentFileSizeAuthor
#1 2204829-fix-use-ajax.patch615 bytesPedro Lozano

Comments

Pedro Lozano’s picture

Status: Active » Needs review
StatusFileSize
new615 bytes

This change works for me.

Pedro Lozano’s picture

Issue summary: View changes
Pedro Lozano’s picture

Issue summary: View changes
malovanets’s picture

Status: Needs review » Fixed

Thanks for the contribution. This is probably the smartest solution for that issue. Committed.

damonbla’s picture

Hi, I'm actually still having this problem, even with both the updated code and setting "Use AJAX" to Yes in the view. When I try to go to another page of items with the pager, I get a popup saying "Are you sure you want to leave this page?" and if I click "Leave page" I get the JSON dump.

Note that when just looking at the view preview in the Views interface, it works perfectly fine. Is there anything besides this AJAX thing that could be causing it? The problem happens in both Chrome and Firefox at least on Mac OS X.

damonbla’s picture

Status: Fixed » Active
jon pugh’s picture

Keeping this one open, marked #2192923: Exposed filter, works in view, stops working in node form - AJAX 200 as a dupe.

Latest commit and it's still broken.

Here's a breakdown:

Views building Interface

On the edit view page, there is strange behavior (with or without AJAX enabled):

  • Pager clicks load with Ajax properly.
  • Exposed filter entry does NOT load with AJAX, ends up on another page. (like admin/structure/views/nojs/preview/VIEWNAME/entityreference_view_widget_1?title=test)

Node Editing Interface

On the edit node page, strange things happen as well...

  • Pager clicks don't trigger Ajax loading, they load the JSON for the widget right in the browser.
  • Exposed filter searches attempt to load AJAX, but, based on my inspections, are POSTing to the wrong URL: It is POSTing to the basepath of the site. This returns the full body of the homepage, with a javascript alert() with: "An AJAX HTTP error occurred. HTTP Result Code: 200"
jon pugh’s picture

So I was able to get the module to work properly with a new content type and a new view.

Now I'll try to narrow down what was conflicting with it on my site.

damonbla’s picture

Hi Jon, thanks for checking this out! I tried a new view (and in fact deleting and reinstalling this entire module) and that didn't work. I did not try a new content type though. Did you manage to narrow down what the conflict was?

jsacksick’s picture

Status: Active » Closed (cannot reproduce)