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!)
Comment | File | Size | Author |
---|---|---|---|
#8 | editableviews-form-action-broken-on-ajax-call-2505849-8.patch | 977 bytes | davewilly |
|
Comments
Comment #1
diego.pasc CreditAttribution: diego.pasc commentedComment #2
diego.pasc CreditAttribution: diego.pasc commentedComment #3
davewilly CreditAttribution: davewilly as a volunteer commentedThis 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.
Comment #4
strainyy CreditAttribution: strainyy as a volunteer and commentedI haven't tested this patch as yet, but it seems like a logical fix. Does anybody know whether this might break anything else?
Comment #5
chertzogThis 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.
Comment #6
Collins405 CreditAttribution: Collins405 commentedJust backing up #5's RBTC, patch works perfectly, thank you very much!
Comment #7
joachim CreditAttribution: joachim commentedThanks for the patch and the review.
Needs a bit of a cleanup:
Comments need to wrap to 80 lines.
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.)
Comment #8
davewilly CreditAttribution: davewilly as a volunteer commentedThanks joachim, this should now be cleaned up.
Comment #9
lunk rat CreditAttribution: lunk rat commented+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.
Comment #10
estratos2 CreditAttribution: estratos2 commented#3 works for me tested on 7.x
7.x-1.0-beta10
Exposed filters works too
Comment #11
davewilly CreditAttribution: davewilly as a volunteer commentedComment #12
davewilly CreditAttribution: davewilly as a volunteer commented@lunk_rat did you find anything through further testing? Thanks
Comment #13
staniel25 CreditAttribution: staniel25 commentedAfter 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.
Comment #14
davewilly CreditAttribution: davewilly as a volunteer commented@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())) {
Comment #15
manoloka CreditAttribution: manoloka commentedmy 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?
Comment #16
manoloka CreditAttribution: manoloka commentedPatch in #3 worked for me
Comment #17
jimmythefung CreditAttribution: jimmythefung as a volunteer commentedI 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.
Comment #18
kellyimagined CreditAttribution: kellyimagined commented#8 works great
Comment #19
Proteo CreditAttribution: Proteo as a volunteer commentedTried 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.
Comment #20
DuneBL#8 save my day!
Comment #21
robertwb CreditAttribution: robertwb commentedWorks like a champ. Would be cool to have it committed.
Comment #22
bcobin CreditAttribution: bcobin commentedNot 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...
Comment #23
joachim CreditAttribution: joachim as a volunteer commentedSetting to NW based on last comment.
Comment #24
bcobin CreditAttribution: bcobin commentedThank you for looking into this. Let me know if there’s anything I can do to help.
Comment #25
woodhome CreditAttribution: woodhome commentedNo problem with patch #8 using exposed filters in block with ajax and 'input required' exposed form style.