0

I have a an embedded view display (type = embed) with an exposed form and pager. Ajax is enabled for the display. The pager reloads the display via ajax, however the form does not. I'm all but certain the form used to trigger an ajax reload, but no longer does, and I'm not sure why.

I have used the viewsreference module, viewfield module, and straight views_embed_view() to embed the display and none produce a display where the form reloads via ajax. I have other sites using all three of these methods and those sites all have properly functioning views with ajax forms.

I have used the "Duplicate this display as Block" option in the views ui, placed the block on a page, and that form does reload via ajax properly.

I have tried different themes, including core themes, and the form still doesn't reload the display via ajax.

As far as I can tell, there's no markup difference between displays where views exposed forms are processed via ajax and those that aren't. (Comparing with another site. It seems that all embed display forms on this site won't filter the view via ajax.)

I don't have any custom code interacting with the views or their forms.

Does anyone have any idea what may cause Drupal views exposed forms to not process via ajax? Or can anyone recommend a way to further debug this?

  • 1
    This looks like the ajax behavior isn't attached to the exposed form, could be connected to the way the exposed form is rendered or delivered, Since you've already checked the rendered HTML the second thing to debug would be the code in ajax_view.js, when the page is loaded, not when you submit the form, then it's already too late. – 4k4 Sep 23 '19 at 20:29
0

Thanks @4k4. Your comment started me poking around in ajax_view.js which ultimately led me to the cause. My issue was that my display ids had multiple underscores in a row, e.g. listing__large. If I update the display id to large_listing everything works fine. I guess multiple underscores in a row aren't supported in the display ids, and I'm guessing also with view ids.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.