Download & Extend

Fatal error: Call to undefined function geonames_geocode_handler_info()

Project:Geocode
Version:6.x-1.0-alpha1
Component:Code
Category:bug report
Priority:normal
Assigned:Unassigned
Status:needs work

Issue Summary

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:

<?php
 
// 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

#1

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

<?php
//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.

#2

Project:GeoNames» Geocode
Version:6.x-1.2» 6.x-1.0-alpha1
Priority:critical» normal

Geocode wont works properly with Geonames

#3

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 ;)

#4

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

#5

sub

#6

#7

sub

#8

#9

One year later the error is still here.

#10

@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.

#11

Still getting this error. Anyone ever look at this?

#12

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.

nobody click here