I tried to install the new captcha, but admin/user/captcha/image_captcha gives me always a blank page. Moreover in "captcha type (module)" select, I see only "Math type" or "none" (and not "Image captcha as in 3.0-rc1).
I have also tried to uninstall and reinstall image_captcha module and captcha module, clear cache, copied two ttf fonts in image_captcha/fonts directory and check in db for a cleaned uninstall... but image_captcha doesn't work for me!
Do you know where can be the problem? Some mine mistake or o bug?
Thanks a lot,
Saxx

CommentFileSizeAuthor
#8 array_combine_bug.patch949 bytessoxofaan

Comments

soxofaan’s picture

And you don't even get an error message saying something about installing a TTF font or missing image library?
Can you also check the watchdog log at admin/logs/watchdog and see of there are captcha related errors?
Could you generate images with 3.0-rc1?

thanks for testing and reporting

SaxxIng’s picture

<>

No... any message regards fonts or libraries!

<>

Nothing about captcha related errors

<>

Yes, 3.0-rc1 works perfectly for me (also image_captcha).

Glad to be helpeful,
Saxx

soxofaan’s picture

but admin/user/captcha/image_captcha gives me always a blank page

What do you mean with a blank page?

  • no page at all (e.g. everything is white)?
  • an empty drupal page (you get a page with header, side bars and stuff, but no real content in the "content" area)

can you check the error log of your webserver/php engine?

how "clean" is your drupal install (how many non-core modules do you have enabled, do you hack modules yourself, ....)?

SaxxIng’s picture

What do you mean with a blank page?

I mean that everything is white

can you check the error log of your webserver/php engine?

I'm not sure... I'm in a shared hosted on a CentOS linux machine... where should I find this informations?

how "clean" is your drupal install (how many non-core modules do you have enabled, do you hack modules yourself, ....)?

Well... I've a lot of modules, but non hacked myself. The only one "strange" is localizer 1.9 (that needs a patch to some core modules). The strange thing is that 3.0-rc1 works perfectly with all this modules (localizer included). Moreover, text_captcha (in 3.0-rc2) works perfectly.
Tell me if you need some more informations or some kind of test!
Saxx

soxofaan’s picture

I mean that everything is white

That probably means the webserver/php engine is not happy with some code. An error log of the server would be handy. With some hosting solutions you have an option to disable/enable (php) error reporting. Mostly error reporting is disabled for security reasons however. Or sometimes you can download the error log through some web interface of your hosting account.

in the meantime you could try to disable modules and see if image captcha gets its settings page back.

SaxxIng’s picture

I have enabled apache/php display_error and I find this message attempting to get admin/user/captcha/image_captcha page:

Fatal error: Call to undefined function: array_combine() in /var/***/sites/all/modules/captcha/image_captcha/image_captcha.module on line 109

Is this helpful?
Saxx
P.S. I have php 4.3.9 installed on my host

soxofaan’s picture

Assigned: Unassigned » soxofaan

Fatal error: Call to undefined function: array_combine() in /var/***/sites/all/modules/captcha/image_captcha/image_captcha.module on line 109

Is this helpful?

This is very helpful indeed. (error messages rule)
Apparently array_combine() is a PHP 5 only function. Good to know (because I use it a lot in CAPTCHA Pack).

A quick fix for you is to put this somewhere in image_captcha.module:

function array_combine($keys, $values) {
  $result = array();
  foreach(array_map(null, $keys, $values) as $pair) {
    $result[$pair[0]]=$pair[1];
  }
  return $result;
}

I'll take a look to fix it in a cleaner way.

soxofaan’s picture

Status: Active » Reviewed & tested by the community
StatusFileSize
new949 bytes

patch for avoiding array_combine() in image_captcha

SaxxIng’s picture

Thanks a lot soxofaan!
Your patch (and also your workaround) works perfectly! Now captcha_5.x-30.-rc2 works perfectly and is quite a perfect module!
Great work guys,
Saxx

robloach’s picture

Title: Blank page in config image_captcha » PHP 4 Compatibility - array_combine
Status: Reviewed & tested by the community » Fixed
Anonymous’s picture

Status: Fixed » Closed (fixed)