Hi,

For some reason when I enable admin menu and go to any nodes that I have added to the menu, they are displayed as node/33 (for example) rather then "about-us"

What am I missing? When I disable the menu it works perfectly.

Thanks

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

owenpaula’s picture

Assigned: Unassigned » owenpaula

Hello adam3145:

I tried to duplicate the issue you identified above in an effort to help resolve for you. When taking the following steps, I was not able to duplicate the issue. If you do not have this resolved, maybe you can provide more detail about your environment and I will try to duplicate again. Here's what I tested in Chrome:

-Fresh copy of core = Drupal 7.15
-Created basic page titled "about us", added a URL alias of about-us, added to Main Menu.
-Navigated using Main Menu and Dashboard to About Us page and URL = /about-us
-Installed and enabled Admin Menu 7.x-3.0-rc3
-Navigate Home then navigated to About Us via Main Menu and Dashboard and URL = /about-us
-Installed and enabled Admin Menu 7.x-3.0-rc3
-Navigate Home then navigated to About Us via Main Menu and Dashboard and URL = /about-us

Spider_

jlockhart’s picture

I know this is a really old issue but I just noticed this on one of our dev sites. I was trying to create a handbook using the book module, using the default menu settings on the node edit form, and adding links to the admin menu. I have pathauto installed and the links are directly to the node not to the alias. i.e. /node/1 rather than /handbook. I noticed this issue and thought I should try on a clean copy. So I have a fresh copy of D7, the Admin Menu, Pathauto, and Token installed. The URL alias is working for the article. I added the link to the Main menu and when I roll over it you can see the full alias. I added the link to the Admin menu in the same way and when I roll over the link you can see its giving me the node/nid path.

Working path Alias

Main Menu using path aliases

Not Working alias

Admin Menu not using path alias

I'll try to track this down myself, but thought I'd give more feedback.

jlockhart’s picture

Issue summary: View changes
FileSize
729 bytes

I was able to find a fix but I'm not entirely sure its correct. I've added a drupal_get_path_alias to the theme_admin_menu_links function. Basically if the path module is enabled there will most likely be aliases, so check that and check that an alias exists. If so then replace the path with the alias. I'm a little confused though, since I thought the l() function already does that. However, this patch does work, I've tested it on my local and our dev server.

RAFA3L’s picture

thanks @jhenson your patch work fine

tille’s picture

hi there,

got the same problem, tried the patch, all caches cleared, but no changes :/

update: my problem was language prefs related – switched language and all is fine.

greetz, t.

DrCord’s picture

The patch in #3 worked great to fix this problem for me as well.

jlockhart’s picture

Category: Support request » Bug report
Status: Active » Reviewed & tested by the community

Status: Reviewed & tested by the community » Needs work

The last submitted patch, 3: urlaliasnotdisplaying-1742844-3.diff, failed testing.

jlockhart’s picture

Looks like I need to re roll this

jlockhart’s picture

Status: Needs work » Needs review
FileSize
785 bytes

I downloaded the latest version of admin menu and this still seems to be an issue. I've rerolled the patch to apply to the latest version. Please test.

Status: Needs review » Needs work

The last submitted patch, 10: urlaliasnotdisplaying-1742844-10.diff, failed testing.

jlockhart’s picture

Version: 7.x-3.0-rc3 » 7.x-3.0-rc5
Status: Needs work » Needs review

wrong version... this time for sure.

nico.knaepen’s picture

Status: Needs review » Needs work

Patch needs work.

+++ b/admin_menu.module
@@ -677,6 +677,14 @@ function theme_admin_menu_links($variables) {
+      // If the path has an alias replace the href with the alias

The code on line 681 contains '}' in version 7.x-3.0-rc5. Thereby patch is not applicable.

Please do start the patch from the correct version in order to be able to apply that patch.

jlockhart’s picture

Version: 7.x-3.0-rc5 » 7.x-3.x-dev
Status: Needs work » Needs review
FileSize
731 bytes

Sorry I guess this was for dev. I just downloaded the latest dev, and tested it on a clean install. Same issue. Applied this new patch and the url alias is used.

nico.knaepen’s picture

Reviewed code, only some coding standards issues.

  1. +++ b/admin_menu.module
    @@ -676,6 +676,13 @@ function theme_admin_menu_links($variables) {
    +      ¶
    

    White spaces not allowed here.

  2. +++ b/admin_menu.module
    @@ -676,6 +676,13 @@ function theme_admin_menu_links($variables) {
    +      // If the path has an alias replace the href with the alias
    

    End text with full stop.

nico.knaepen’s picture

Status: Needs review » Needs work
jlockhart’s picture

Status: Needs work » Needs review
FileSize
731 bytes

Hows that?

nico.knaepen’s picture

Status: Needs review » Reviewed & tested by the community

That's better.

  • truls1502 committed 67a9e41 on 7.x-3.x
    Issue #1742844 by jlockhart, nico.knaepen, truls1502: URL Alias not...
truls1502’s picture

Status: Reviewed & tested by the community » Fixed

Fixed and added in 7.x-3.x-dev

Status: Fixed » Closed (fixed)

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