Closed (fixed)
Project:
CAPTCHA
Version:
5.x-3.0-rc3
Component:
Image Captcha (image_captcha)
Priority:
Normal
Category:
Support request
Assigned:
Unassigned
Reporter:
Created:
20 Sep 2007 at 16:12 UTC
Updated:
25 Oct 2007 at 08:43 UTC
Jump to comment: Most recent file
Comments
Comment #1
Nikkol commentedthis may be part of the problem .... error in logs ...
Table 'drupal.captcha_points' doesn't exist query: SELECT module, type FROM captcha_points WHERE form_id = 'search_block_form' in E:\drupal-5.2\includes\database.mysql.inc on line 172.
Comment #2
soxofaan commentedYou need the GD library (which is typically enabled in a default PHP install as far as I know). see http://php.net/manual/en/ref.image.php
"image_captcha" is not a real file system path, it is a so called "drupal path". Just like the drupal paths "node/10" and "admin/settings" e.g. It is all right.
I guess you upgraded from a previous version of captcha. Is that right? Did you run the update.php script?
Comment #3
robloachDoes Clean URLs have to be on in order to use Image Captcha? If so, should we implement clean URL support into the module?
Comment #4
soxofaan commentedI don't see any point in "supporting" clean URLs,. They are provided by Drupal transparently (by using the l() function). I don't think any module has to "do"/"know" something in order to "use" clean URLs. The image CAPTCHA just uses standard Drupal links/paths/urls, so I don't see a problem.
Comment #5
robloachYup, works without Clean URLs enabled:
Did you find the problem, Nikkol?
Comment #6
Nikkol commentednot yet, but I think that it may be a clean url problem. I'm on IIS using ISAPI rewrite. I'll do more troubleshooting and see what I come up with.
Comment #7
Nikkol commentedit appears to be something with my php/gd install. I ran a simple gd test script and get a broken image that way too. I'm in the process of setting up a new server, so I think I'll put this on hold and hope a brand new install of php will work.
Comment #8
wilei commentedI had this problem too, and I found out that reason for this problem is incomplete path to used font. With rc1 all works fine, because in its image captcha configuration you should type full path to font -file, but in rc3/dev you have just dropdown list of "installed" fonts. And with that path is incomplete.
For now I fixed it with just adding this line
$font="/full/path/to/your/drupal/installation/".$font;just after lines with
list($font, $errmsg) = _image_captcha_get_font();in functions _image_captcha_generate_image() and image_captcha_captcha()
Without full path to file, PHP tries to find font from library-defined font path. See: http://fi.php.net/imagettfbbox and that's why full path to font file is needed.
Comment #9
soxofaan commentedat #8:
does this patch also solves your issue?
(I can't reproduce your problem because I have a different PHP/GD version probably)
Comment #10
wilei commentedat #9:
Patch fixes problem with rc3. But personally I don't like usage of realpath like this :) I think that "basepath" of any drupal/etc. installation is some of most critical things to define or check when handling files and it should be done by some other way than using realpath places like in patch...
Comment #11
soxofaan commentedat #10:
I don't understand your problem with realpath. We just need the the full absolute path of a given relative path and realpath delivers that as far as I know. If you know a better function, please make it known.
Comment #12
soxofaan commentedI've looked in Drupal core, and the function realpath() is used in includes/file.inc a couple of times.
I still don't understand the problem of #10
Comment #13
robloachI think he's worried about storing the absolute path, used when using realpath(), inside the database. We should have it use the path relative to the Drupal root directory so that if you move the Drupal folder, you don't run into Captcha problems when it looks for the font in a none existent directory.
Does this patch help? Instead of passing the relative path to the GD functions, it passes the realpath of the font, only if it's not the built in one.
Comment #14
soxofaan commentedpatch from #13 is indeed better
Comment #15
soxofaan commentedcommitted: http://drupal.org/cvs?commit=83989
Comment #16
(not verified) commented