Hi,

I just installed the plugin and i got a white screen.
Enabling the error_report, i see this message:

Fatal error: Call to undefined function geonames_geocode_handler_info() in /myserverpath/httpdocs/sites/all/modules/geocode/geocode.module on line 95

In the line 95 of the geocode.module file, there is:

  // Based on availablilty, include handlers that leverage installed modules.
  // This is for some out-of-the-box interoperability, but should be supplanted
  // by modules implementing hook_geocode_hander_info() on their own.
  $dir = drupal_get_path('module', 'geocode') . '/includes/modules/';
  foreach (file_scan_directory($dir, '\.inc$') as $file) {
    if (module_exists($module = $file->name)) {
      $func = $module . '_geocode_handler_info';

      // Call hook_geocode_handler_info() if the module doesn't account for it.
      if (!function_exists($func) && !function_exists($func .'_alter')) {
        require $dir . $module .'.inc';
        $handlers = array_merge($handlers, $func()); //THIS IS LINE 95
      }
    }
  }

Looking into the geonames.module file, there isn't any geonames_geocode_handler_info() hook, i suppose this is the problem.

Comments

strae’s picture

...maybe i did good, or maybe i did wrong, but i just edited the line 95:

//it was:
$handlers = array_merge($handlers, $func());
//now is:
if(function_exists($func)){
  $handlers = array_merge($handlers, $func());
}

..and for now seem to work.
Maybe (porobably) the hook wont be called properly, im waiting for a patch.

strae’s picture

Project: GeoNames » Geocode
Version: 6.x-1.2 » 6.x-1.0-alpha1
Priority: Critical » Normal

Geocode wont works properly with Geonames

allie micka’s picture

Status: Active » Needs work

Nobody has written the Geonames integration :(

It should be relatively quick to do, and I'd love a volunteer! At some point I'll get to it on my own if there are no takers. But it would be nice if I didn't have to ;)

strae’s picture

I would be happy to help, but im pretty new to drupal, dont know if i really am able to do that (..yet!)

maedi’s picture

sub

mr.baileys’s picture

asb’s picture

sub

lyricnz’s picture

bunker’s picture

One year later the error is still here.

lyricnz’s picture

@bunker: the maintainer of Geocode has already asked for someone to step up and write the geocode-geonames integration. If nobody does it, it doesn't get done.

paulgemini’s picture

Still getting this error. Anyone ever look at this?

hvalentim’s picture

Still getting this today indeed: http://drupal.org/node/1324128

This is a critical problem since one is unable do access most admin with a 500 error.

I applied the fix in comment 1 and was able to restore access to the admin pages.