Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
If in include image captcha as a dependency in my profile.info.yml it image_captcha_requirements fails with:
Fatal error: Call to undefined function _image_captcha_check_setup() in /home/matslats/localhost/drupal8/modules/contrib/captcha/image_captcha/image_captcha.install on line 17
This function is in the .module file which hasn't been included.
Comment | File | Size | Author |
---|---|---|---|
#2 | captcha-module-file-include-2636772-1-8.x-1.0-alpha0.patch | 784 bytes | jamin_melville |
|
Comments
Comment #2
jamin_melville CreditAttribution: jamin_melville at University of Adelaide commentedpatch gets around issue of
module_load_include('module', 'image_captcha')
returning false by usinginclude_once
instead.module_load_include('module', 'image_captcha')
method callsdrupal_get_path('module', 'image_captcha')
which returns an empty string.drupal_get_path('module', 'image_captcha')
callsdrupal_get_filename('module', 'image_captcha')
which returns NULL.Comment #3
kerby70 CreditAttribution: kerby70 at FFW commented#2 works. I have tested this, on install added as a dependency of a copy of the lightning distribution, without any errors or unexpected behavior.
Calls to hook_requirements during installation of Drupal, such as an installation profile, will not have access to all Drupal API's (per comment on .
Relates to #704110: Prevent installation of image CAPTCHA module when no GD available (with support for installation profiles), unlike that solution using __DIR__ (supported in PHP 5.3+) is more efficient, than dirname(__FILE__).
Comment #5
elachlan CreditAttribution: elachlan commentedThanks for the RTBC