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.
Hi,
I got the following error when moving this module to a subfolder in sites/all/modules, even after using Registry Rebuild. It might be preferable to use module_load_include() instead of require_once or include statements, as described here.
[17-Sep-2013 16:59:17 UTC] PHP Fatal error: require_once() [<a href='function.require'>function.require</a>]: Failed opening required 'geofield.widgets.inc' (include_path='.:/Applications/MAMP/bin/php/php5.3.14/lib/php') in /path/to/drupal/sites/all/modules/geofield/geofield.module on line 3
No such file, line 8 of
/path/to/drupal/sites/all/modules/geocoder/geocoder.module
Comment | File | Size | Author |
---|---|---|---|
#2 | use-module_load_include-2091251-2.patch | 1.52 KB | gmclelland |
#1 | 2091251-1-geofield_module_load_include.patch | 595 bytes | alberto56 |
Comments
Comment #1
alberto56 CreditAttribution: alberto56 commentedHere is a patch that does this.
Comment #2
gmclelland CreditAttribution: gmclelland commentedI haven't tested the patch in #1 yet, but the code looks correct.
Here is some more background reading:
http://buildamodule.com/blog/the-correct-way-to-include-files-in-your-dr...
https://api.drupal.org/api/drupal/includes%21module.inc/function/module_...
Here is the patch for the 2.x-dev
The patch in #1 is for the 1.x-dev
Comment #3
bneil CreditAttribution: bneil commentedI've manually tested the patch in #2 without issue.
Comment #4
Brandonian CreditAttribution: Brandonian commentedThanks for the patch @gmclelland! Committed.
http://drupalcode.org/project/geofield.git/commit/3116ca0