This error now comes up after updating to Drupal 7.39+. AJAX url reponses are now validated. When clicking on a toggle for Attended for example the above error pops up each time the toggle is clicked.

Comments

dpfitzsi created an issue. See original summary.

dpfitzsi’s picture

rudiedirkx’s picture

Status: Needs review » Fixed

I've never understood this 'protection'. If 'user-uploaded files' can call Ajax, they surely can add something to Drupal.settings, which would make this 'protection' useless. They can also call Ajax without Drupal.ajax, or even jQuery.ajax, and they can execute any Ajax commands...

Anyway, good point. I've committed something slightly different.

  • rudiedirkx committed c32b691 on 7.x-1.x
    Issue #2598470: Ajax "The response failed verification so will not be...

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.

danuddara’s picture

I have added his custom code to a module to override the settings in misc/ajax.js. This worked for me. you can alter it for your problem.

function hook_js_alter(&$javascript)
{
global $base_url;

drupal_add_js(
array(
'urlIsAjaxTrusted' => array($base_url."/your/ajax/ur"=>true)
),
'setting'
);

}

// console.log(Drupal.settings.urlIsAjaxTrusted[ajax.url]) in misc/ajax.js to find out the ajax call when triggering the event.

more info : https://www.drupal.org/node/2572117

rudiedirkx’s picture

The patch in #2 and commit in #4 don't work? Those are the way to go, not custom adding JS settings.

danuddara’s picture

sorry mate, i was working out another custom project related to this error "The response failed verification so will not be processed". it gave me this link on google first. i just posted it to help the AJAX problem with misc/ajax v7.39.

Thought someone might find it useful here.