Hiya,

Great little module but didn't output the correct links on my site. I have a large menu 2 so I set it to recurse only one level. Some of the links it found were correct, some led to 'Page not found' errors. On the ones that were correct, for exampe /node/1, once clicked, the link would change to /node/node/1, clicked again it would be /node/node/node/1 and so on.

Also, on the admin pages, it created completely incorrect links to /admin/settings/node/1 or something like that.

I'm just gonna hard-code my footer links now...

Comments

mradcliffe’s picture

Assigned: Unassigned » mradcliffe
Priority: Normal » Critical
Status: Active » Needs work

Yes! You may not think someone would be excited, but I had seen this on one other site. I had been looking to duplicate it on some test sites, but it looks to only effect clean urls.

I had wrote a quick fix on a client's site because I knew it didn't use any funky links.

In the recursive function I concatenated '$base_url' . "/" . $h->alias (or $h->path). However if for some reason a menu item links off-site this may break things.

Thanks for bringing this to my attention as I've been looking for another confirmation of this bug.

mradcliffe’s picture

Status: Needs work » Fixed

Hmm, the best I could do was to put in some regex in case there are external urls in menus. However I re-implemented concatenating $base_url . "/" . $h->path.

Thank you, patch should be committed in the next snapshot generated release. I've tested on one 4.7 site with clean urls and another 4.7 site without clean urls. It should theoretically work fine with 5.x.

or you could try patching...

diff -u -r1.2.2.5 footermap.module
--- footermap.module    29 Aug 2007 17:44:55 -0000 
+++ footermap.module    2 Sep 2007 06:09:48 -0000
@@ -134,10 +134,17 @@

       while( $h = db_fetch_object($r) )
       {
-           $a = 1;
+          if( $level == 2 )
+                $a = 1;

            if( $h->alias )
                 $h->path = $h->alias;
+          else
+               if( preg_match("/^http|www/",$h->path) == 0 ) /* we need not match external links */+                       $h->path = $base_url . "/" . $h->path; /* for clean urls */
+
+          if( $h->path == "/" )
+               $h->path = $base_url;

            if( $level > 1 && ($h->path <> "") )
                 $temp .= "\t<span class=\"footermap-item\"><a href=\"$h->path\">$h->title</a> &#xb7; </span>";
@@ -148,7 +155,7 @@

            $i = footermap_get_menu($h->mid,($level+1),$a,$temp,$limit);

-           if( $i != 0 )
+           if( $i > 0 ) /* let's make this consistant with drupal-4-7, is it ok? */
           {
                $temp .= "<br>\n";
                 $temp = preg_replace("/&#xb7; (\S+)$/","$1",$temp);
mradcliffe’s picture

Status: Fixed » Closed (fixed)

closing.