I have a simple editable view containing only one 'content pane' (as I use it in a panel page), showing a list of nodes.
One field is editable.
I also have an exposed filter based on (another) field.
The view has "Use AJAX: Yes"
At first in the panel page I can edit the field as it should be.
But if I use the filter, when I then try to change the field I get a black page with this error (and the field remains unchanged):

[{"command":"settings","settings":{"basePath":"\/","pathPrefix":"","ajaxPageState":{"theme":"myboot","theme_token":"4FxBV4e6iqlvt_rEO7meXNqje7GI6OHsuBSNHaACRRo"},"overlay":{"paths":{"admin":"node\/*\/access\noverlay\/dismiss-message\nadmin\nadmin\/*\nbatch\ntaxonomy\/term\/*\/edit\nuser\/*\/cancel\nuser\/*\/edit\nuser\/*\/edit\/*","non_admin":"admin\/structure\/block\/demo\/*\nadmin\/reports\/status\/php"},"pathPrefixes":["en","es"],"ajaxCallback":"overlay-ajax"}},"merge":true}]

WORKAROUND: if I set "Use AJAX: No", it works

PS: I tried setting "Use Panel path: Yes" in the Pane Setting of my view but it didn't work.

I set it as a minor bug as there is a workaround in the end.

Just wanted to inform the module maintainer about this issue with some details of mine (btw thanks a lot for this wonderful module!)

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

diego.pasc’s picture

Issue summary: View changes
diego.pasc’s picture

Issue summary: View changes
davewilly’s picture

This is caused by the ajax request rebuilding the form and changing the #action path to '/views/ajax'.

I have created a patch which rebuilds the action if an ajax request occurs on the view. It's tested with ajax exposed filters, table sorts and pager.

strainyy’s picture

Status: Active » Needs review

I haven't tested this patch as yet, but it seems like a logical fix. Does anybody know whether this might break anything else?

chertzog’s picture

Status: Needs review » Reviewed & tested by the community

This patch fixes the problem for me. I had an ajax pager and submitting the form on any page past 1, resulted in the error. After applying this patch, everything looks good.

Collins405’s picture

Just backing up #5's RBTC, patch works perfectly, thank you very much!

joachim’s picture

Status: Reviewed & tested by the community » Needs work
Issue tags: -filter, -Ajax

Thanks for the patch and the review.

Needs a bit of a cleanup:

  1. +++ b/editableviews_plugin_style_row_edit_table.inc
    @@ -319,6 +319,19 @@ class editableviews_plugin_style_row_edit_table extends views_plugin_style_table
    +    // If we make an ajax call, perhaps with exposed filters or table sorts
    +    // we must explicitly set the form #action or it will be changed to /views/ajax and break things.
    +    // Check if we have post data, if so.. assume it's from exposed filters or sorts and rebuild the action path.
    

    Comments need to wrap to 80 lines.

  2. +++ b/editableviews_plugin_style_row_edit_table.inc
    @@ -319,6 +319,19 @@ class editableviews_plugin_style_row_edit_table extends views_plugin_style_table
    +    if(!empty($_POST)) {
    

    Space missing after the if.

(BTW: please don't use the tags field for random tags. Please read the help text on it if you want to find out more about what it's meant to be used for.)

davewilly’s picture

Status: Needs work » Reviewed & tested by the community
FileSize
977 bytes

Thanks joachim, this should now be cleaned up.

lunk rat’s picture

+1 to RTBC for this. It fixes the issue on my install. Thank you!

After a bit more testing, I am seeing some strange behavior - my AJAX exposed filters randomly disappear. Reverting the patch and clearing caches gets them back. I will do more testing to find specifics.

estratos2’s picture

#3 works for me tested on 7.x
7.x-1.0-beta10

Exposed filters works too

davewilly’s picture

davewilly’s picture

@lunk_rat did you find anything through further testing? Thanks

staniel25’s picture

After successful patch using #8, I get the following when editing a View Format with 'editable table'. The view is very simple, just a few fields.
Any thoughts?

An AJAX HTTP error occurred.
HTTP Result Code: 200
Debugging information follows.
Path: /admin/structure/views/view/vbo/preview/page_2/ajax
StatusText: OK

Edit: I am using exposed filters.

davewilly’s picture

@staniel25 The error is not present without the patch?

Could try disabling the fix on views admin, replace:
if(!empty($_POST)) {
with
if(!empty($_POST) && !path_is_admin(current_path())) {

manoloka’s picture

my 5 cents ... It's really weird

I am getting a similar Ajax error;

[{"command":"settings","settings":{"basePath":"\/","pathPrefix":"","ajaxPageState":{"theme":"mix_and_match","theme_token":"ssP3pdnAM-t-7adDPR4wLNwFVeFYvbM9q49z5HKhF4E"},"colorbox":{"transition":"elastic","speed":"350","opacity":"0.60","slideshow":true,"slideshowAuto":true,"slideshowSpeed":"5000","slideshowStart":"play","slideshowStop":"stop","current":"{current} de {total}","previous":"\u00ab-","next":"-\u00bb","close":"Cerrar","overlayClose":true,"maxWidth":"98%","maxHeight":"98%","initialWidth":"300","initialHeight":"250","fixed":true,"scrolling":true,"mobiledetect":true,"mobiledevicewidth":"200px"},"popup":{"effects":{"show":{"default":"this.body.show();","fade":"\n if (this.opacity){\n this.body.fadeTo(\u0027medium\u0027,this.opacity);\n }else{\n this.body.fadeIn(\u0027medium\u0027);\n }","slide-down":"this.body.slideDown(\u0027medium\u0027)","slide-down-fade":"\n this.body.animate(\n {\n height:\u0027show\u0027,\n opacity:(this.opacity ? this.opacity : \u0027show\u0027)\n }, \u0027medium\u0027\n );"},"hide":{"default":"this.body.hide();","fade":"this.body.fadeOut(\u0027medium\u0027);","slide-down":"this.body.slideUp(\u0027medium\u0027);","slide-down-fade":"\n this.body.animate(\n {\n height:\u0027hide\u0027,\n opacity:\u0027hide\u0027\n }, \u0027medium\u0027\n );"}},"linger":"250","delay":"0"}},"merge":true}]

Then I tried the workaround (switching Ajax off) and it worked once, but the next time I would Not get the Ajax error but not changes were saved.

Then I switch Ajax on again and it worked without the error, also only once and then back to the Ajax error.

This pattern seems to keep on and on, sometimes it works once, twice or a few times, then get the error ... then if I do the same, switching Ajax on & off and I get it to work a few more times but seems that doesn't stay stable for long.

weird hu?

manoloka’s picture

Patch in #3 worked for me

jimmythefung’s picture

I came across the same problem even after applying patch #8 to "editableviews_plugin_style_row_edit_table.inc".
The editable view I use is in the form of a Block, and the content is unformatted table.

Then I noticed there's a file by the name "editableviews_plugin_style_edit_unformatted.inc" which sounds more relevant to my content. I opened it up and inserted the patch#8 code.

Problem solved. It worked like magic.

kellyimagined’s picture

#8 works great

Proteo’s picture

Tried patch from #8 and it works, but the pagination still is messed up (not the patch's fault). Clicking on pagination links that have no query parameters (i.e. 1, "First" and "Previous" if you're in the page 2) won't change the current page.

DuneBL’s picture

#8 save my day!

robertwb’s picture

Works like a champ. Would be cool to have it committed.

bcobin’s picture

Not working for me.

When I try on the Views page, I get:

An AJAX HTTP error occurred.
HTTP Result Code: 500
Debugging information follows.
Path: http://[site]/admin/structure/views/ajax/preview/node_reprocessing/page?live_preview-1&view_args=&form_build_id=form-HASH, etc.

On the actual page, I get white screen.

AJAX is disabled on the view and although I originally had an exposed filter, behavior is the same with fixed filter.

I'm running PHP7.1, Drupal 7.69 - any ideas? This module looks like exactly what I need - when I see the good reviews, I am hopeful! Thanks in advance...

joachim’s picture

Status: Reviewed & tested by the community » Needs work

Setting to NW based on last comment.

bcobin’s picture

Thank you for looking into this. Let me know if there’s anything I can do to help.

woodhome’s picture

No problem with patch #8 using exposed filters in block with ajax and 'input required' exposed form style.