warning: Missing argument 1 for geonames_tools_menu() ... tools.module on line 7.
ica - May 12, 2008 - 08:20
| Project: | GeoNames |
| Version: | 6.x-1.1 |
| Component: | Code |
| Category: | bug report |
| Priority: | critical |
| Assigned: | Unassigned |
| Status: | closed |
Description
warning just after install & activating of the module
warning: Missing argument 1 for geonames_tools_menu() in /home//sites/all/modules/geonames/geonames_tools.module on line 7.

#1
#2
I just downloaded and installed geonames 6.x-1.1 with Drupal 6.2 and got this message. Is there a fix?
#3
I'm having the same problem. Any word on a fix?
#4
...I'm sorry I haven't responded to this earlier; I've been quite busy lately. I tried to fix it in CVS a few weeks ago, but I'm having a hard time with the braching and tagging to get things properly working -- and I don't have the time to spend hours to get this right at this moment.
I'm attaching my working copy of the geonames_tools.module for D6 - let me know if you still have problems after replacing this file.
If any of you guys are handy with the drupal cvs system, please let me know and we can join you as maintainers!
Sero
#5
It's a Drupal core bug. $may_cache is undefined under certain circumstances.
Try
function geonames_tools_menu($may_cache=0) {
Jim Tarvid
#6
I can repeat the symptom and tarvid's patch.
This is related to #205994: Mathfilter_menu() throws missing argument error is Drupal 6.0 RC1
#7
The $may_cache variable is a left over from Drupal 5, it doesn't exist in Drupal 6 and should just be removed...
I must have uploaded my D5 version as a patch -- the menu hook is supposed to look like this:
function geonames_tools_menu() {
$items['geonames/autocomplete'] = array(
'title' => t('Autocomplete Geonames Search'),
'page callback' => 'geonames_tools_search_autocomplete',
'access arguments' => array('access content'),
'type' => MENU_CALLBACK,
);
return $items;
}
I will try to clean up the mess one day I have some time to spend figuring out the tagging and branching properly...
#8
I dowload the version in #4 but the menu is:
<?php
function geonames_tools_menu($may_cache) {
$items = array();
if ($may_cache) {
$items[] = array(
'path' => 'geonames/autocomplete',
'title' => t('Autocomplete Geonames Search'),
'type' => MENU_CALLBACK,
'callback'=> 'geonames_tools_search_autocomplete',
'access' => user_access('access content')
);
}
else {
}
return $items;
}
?>
So i copy/paste the code in #7 and all work good :).
#9
This was somewhat like a blocker for me. It is very nasty to get a error exactly after you install this module.
I attached a patch with SeroSero's solution.
#10
The 6.x-1.x-dev branch already has this code. Try that, until the next version of the module is released. Please let me know if this works for you.
#11
This appear appears to be resolved. In any case, this module isn't very useful right now, so it's unlikely anyone enables it.
#12
Automatically closed -- issue fixed for 2 weeks with no activity.
#13
Solved in -dev; this made my day. I don't understand #11. The module is working great. It provides great functionality on my site.