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.

CommentFileSizeAuthor
#9 geonames_tools_menu.patch858 bytesandreiashu
#4 geonames_tools.zip1.12 KB2xe

Comments

2xe’s picture

Version: 6.x-2.x-dev » 6.x-1.1
Status: Active » Fixed
takinola’s picture

Status: Fixed » Active

I just downloaded and installed geonames 6.x-1.1 with Drupal 6.2 and got this message. Is there a fix?

ytorf’s picture

I'm having the same problem. Any word on a fix?

2xe’s picture

StatusFileSize
new1.12 KB

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

tarvid’s picture

It's a Drupal core bug. $may_cache is undefined under certain circumstances.

Try

function geonames_tools_menu($may_cache=0) {

Jim Tarvid

mydllurth’s picture

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

2xe’s picture

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

gagarine’s picture

I dowload the version in #4 but the menu is:


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 :).

andreiashu’s picture

Priority: Normal » Critical
Status: Active » Needs review
StatusFileSize
new858 bytes

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.

lyricnz’s picture

Status: Needs review » Postponed (maintainer needs more info)

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.

lyricnz’s picture

Status: Postponed (maintainer needs more info) » Fixed

This appear appears to be resolved. In any case, this module isn't very useful right now, so it's unlikely anyone enables it.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

cronix’s picture

Solved in -dev; this made my day. I don't understand #11. The module is working great. It provides great functionality on my site.