Having Modal forms & Image CAPTCHA Refresh installed can cause problems if you set the contact form to open in a modal windows and you are not authenticated. It just try to load the new windows but it won't load.

CommentFileSizeAuthor
#6 active_modules.xls126.5 KBwarmth
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

nagdebangshu’s picture

Its not working if its present in a lightbox/facebox etc. The following error message is showing

{"status":1, "message":"", "data":{"url":"\u002Ffolder_name\u002Fimage_captcha\u002F1858?sid=1858\u0026ts=1356339745", "token":"c3731989553deef13d50cd8d3d5ea62f", "sid":"1858"}}

ddrozdik’s picture

Assigned: Unassigned » ddrozdik

Hi,

Thanks for your issue.
This problem was described earlier in the issue http://drupal.org/node/1795280 , on that moment module wasn't published. I will try investigate this problem and fix it, if it's possible.

Thanks,

Dima.

nagdebangshu’s picture

Hey DmitryDrozdik

I could solve the problem by changing the code little bit. I am giving the code below.

Code for image image_captcha_refresh.js

jQuery(document).ready(function(){
jQuery(".reload-captcha-wrapper").html("Generate a new captcha");
jQuery('#reload_id').live('click',function(){
jQuery.ajax({
type:'POST',
async:true,
url:Drupal.settings.basePath+'captcha/refresh',
success:function(response){
jQuery('.captcha').find('img').attr('src', response.data.url);
jQuery('input[name=captcha_sid]').val(response.data.sid);
jQuery('input[name=captcha_token]').val(response.data.token);
}
});

});
});

Add the following at image_captcha_refresh.module:

function image_captcha_refresh_init()
{
drupal_add_js(drupal_get_path('module','image_captcha_refresh').'/image_captcha_refresh.js');
}

Thanks :)

ddrozdik’s picture

Status: Active » Postponed (maintainer needs more info)

Hi all!

Method described in comment #3 is wrong, don't use it.

I have tried to find your problem with module Modal forms and I didn't find any problems. I used 7.x-1.2 version of module and it works well for me.

This result "{"status":1, "message":"", "data":{"url":"\u002Ffolder_name\u002Fimage_captcha\u002F1858?sid=1858\u0026ts=1356339745", "token":"c3731989553deef13d50cd8d3d5ea62f", "sid":"1858"}}" your can see only if file image_captcha_refresh.js wasn't added to page. Please check this.

Please give me more information about your problems, maybe you use another modules which breaks something.

Thanks,
Dmitry.

warmth’s picture

Attaching active modules list

warmth’s picture

FileSize
126.5 KB

As mentioned in my last edited post.

Note: the same bug appears when using LoginToboggan to show registration form and login form on the same page. The second "tab" never shows the reCAPTCHA.

ddrozdik’s picture

Can you check your console via firebug for firefox of via console in google chrome, maybe it has error messages? I can expect only that exist error in javascript.
I see in your list of modules "JQuery Update", which version of jQuery enabled with this module? Can you check how to works without "JQuery Update"(just disable it)?

ddrozdik’s picture

Status: Postponed (maintainer needs more info) » Closed (cannot reproduce)
Martin Mayer’s picture

Issue summary: View changes

I got the same problem on the /user/register page. I am using Image Captcha refresh 7.x-1.6 with CAPTCHA 7.x-1.3. I am not using Modal Form or jQuery update.

When the refresh link is clicked an otherwise empty page appears with the message:

{"status":1,"message":"","data":{"url":"\/image_captcha\/384482?sid=384482\u0026ts=1459163549","token":"7bd69219af5ea02f3e251751418e2de1","sid":"384482"}}

It seems a JSON message is displayed instead of the registration page with a new Image Captcha. Is there anything I can do to help you reproduce that bug?

Martin Mayer’s picture

Status: Closed (cannot reproduce) » Active
ddrozdik’s picture

Hi Martin,

Are you sure that you do not have js errors? Did you check your browser console?