When changing settings specific to Views PDF, after clicking "apply" it results in a long AJAX error message starting with:
An AJAX HTTP request terminated abnormally.
Debugging information follows.
Path: http://mysite.dev/admin/structure/views/ajax/display/another_test_pdf/pd...
StatusText: n/a
CustomMessage: The response failed verification so will not be processed.
ResponseText: [{"command":"settings","settings":"
I suspect this is related to https://www.drupal.org/SA-CORE-2015-003
On the below page it explains how to have your code manually validate the URL.
https://www.drupal.org/drupal-7.39-release-notes
I'm not sure where to begin to fix this.
| Comment | File | Size | Author |
|---|---|---|---|
| #21 | views_pdf-ajax-error-verificatin-failed-2563263-21.patch | 1.19 KB | vegansupreme |
| #13 | views_pdf.png | 106.13 KB | asghar |
| #12 | ajax-test.txt | 3.46 KB | vegansupreme |
| #7 | views_pdf-ajax-error-verificatin-failed-2563263.patch | 678 bytes | asghar |
Comments
Comment #2
troybthompson commentedFor now, I've downgraded to Drupal 7.38, but I'm free to test things when there's a patch.
Comment #3
Feprabel commentedHi, I have exactly the same problem.
Does anybody found how to fix it ?
I don't like the idea to downgrade to Drupal.38 and maybe cause other issues
Comment #4
Anonymous (not verified) commentedI fixed this by adding the following function to your Ajax callback function:
ajax_set_verification_header();Comment #5
vegansupreme commented@bpcarlsen, can you be specific about where that code goes? Does it go somewhere in views_pdf code? I'm not familiar with AJAX in Drupal. Can you make a patch?
Comment #6
argiepiano commentedFor what it's worth: I haven't figured out how to fix the error message. Still, while the error is annoying, all changes to the settings can actually be saved. After making the changes and clicking Apply (you'll get the error - click OK), navigate away from the Views PDF Display, for example, by clicking on the Views link in the breadcrumbs. Then go back to the View - it will show unsaved changes. Click Save to save the new settings. The Ajax call is there only to update the settings window, it does not interfere with the functioning of Views PDF.
Comment #7
asghar commentedHi All
I have resolved the issue and attached the patch. Actually issue is related to views so you can read further details on views issue page https://www.drupal.org/node/2595607. Thanks
Comment #8
asghar commentedDon't be confused .. you can resolve this issue by implemented one of the patch either views_pdf patch ( views_pdf-ajax-error-verificatin-failed-2563263.patch) or views patch https://www.drupal.org/node/2595607. Don't try to implement both. Thanks
Comment #9
asghar commentedComment #10
vegansupreme commentedAsghar,
I'm still getting an error when submitting the form, albeit a much shorter error. I haven't tried the views patch yet. I'll comment on that issue with my results.
Thanks for looking into this! I've been stumped!
For reference, here's the error I got:
An AJAX HTTP request terminated abnormally.
Debugging information follows.
Path: http://www.viewspdf.dev/admin/structure/views/ajax/display/my_view/pdf_1...
StatusText: n/a
CustomMessage: The response failed verification so will not be processed.
ResponseText: [{"command":"settings","settings":{"basePath":"\/","pathPrefix":"","ajaxPageState":{"theme":"seven","theme_token":"e-aSHkQgZ6PPGAFwFkL0tJ1XBcSennh86jOe2gQmqlw","jquery_version":"1.5"},"urlIsAjaxTrusted":{"\/admin\/structure\/vie
Comment #11
asghar commentedCould you attach the module?. I want to see code. Thanks
Comment #12
vegansupreme commentedWhat do you want me to attach? Here's an export of my test view.
Comment #13
asghar commentedI tested the patch on the following environment and scenario.
Drupal versoin: 7.40
Views_pdf: 7.x-1.4
I uploaded the pdf file and submit the settings. Settings saved successfully. See screen short.

Comment #14
vegansupreme commentedThere's no error on PDF Template settings, but the error I got was on "PDF Fields | Settings". Maybe the same fix needs to be applied to views_pdf_plugin_row_fields.inc?
I tried the patch you posted to #2595607: Passing wrong URL to ajax.url and that patch works in all cases as far as I can tell. So maybe that's the better place for the fix.
Comment #15
asghar commentedAsghar: Yes we can fix this by implementing same snippet.
or
We implement the views patch.
Comment #16
killua99 commentedLast comment on the views issue said to use that solution, So which one look the best?
Comment #17
vegansupreme commentedThe Views solution looks better to me. It's a smaller, more upstream solution. And it could fix the same problem in other modules—though I haven't seen other modules having that problem. We'd have to be sure it doesn't introduce regressions in Views. I'd feel better if it passed automated testing, but the tests haven't been run. I'm not sure how to trigger them. Then we have to convince Views maintainers to commit it.
The Views PDF only solution we could commit right away, and regressions, if any would be limited to Views PDF.
Comment #18
troybthompson commentedI used the views patch and that worked for me.
Comment #19
RedsMK commentedI used the views patch and that worked for me too.
Comment #20
vegansupreme commentedLooks like nothing is happening in Views on this issue. I say we commit the patch here, if they do update Views, we can always revert. This is an annoying bug, I hope to be able to commit this patch soon.
Comment #21
vegansupreme commentedHere's asghar's patch also applied to views_pdf_plugin_row_fields.inc.
This seems to solve the error for me in all cases. I plan to commit this to dev soon.
Comment #23
vegansupreme commentedPatch pushed. Maybe we should consider a stable release update with this fix and the last few dev fixes.
Comment #24
joshua.howell commentedpatch in comment #21 works for me also.
Comment #25
killua99 commentedGreat job @vegansupreme! ;D
Comment #27
mrmiso commentedThis didn't work for me on i18n site. The path isn't build correctly as it is missing language prefix. I changed from
$GLOBALS['base_url'] . '/' . current_path()to
$GLOBALS['base_root'] . request_uri().Not sure if this is 100% correct solution but it works for me.
Also if I used FIX commented in Related issues in Views module it also worked correctly.
Comment #28
nwom commentedI have created a new issue with a patch thanks to #27 :). See: #3138231: On Multilingual sites - AJAX Error: The response failed verification so will not be processed