From node/2165395 - comment #1:

I had the admin toolbar working fine until I installed the JS module (as suggested by IP Geolocation Views & Maps module) and enabled it. Once both modules where enabled, I began to see the same issue you are mentioning here. But when I remove the rules from the .htaccess file that process JS calls, the admin menu shows back up. Otherwise I receive a 500 internal server error.

After that it follows an analysis about the issue and a hack.

Here to help.

CommentFileSizeAuthor
#6 js_admin_menu-2216061-6.patch911 bytestripper54
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

SDWM’s picture

After some debugging i noticed that the path of the admin menu is '/js/admin_menu/cache/'.
Since '/js/' is rewritten to js.php it gives a 500 error, i changed the htaccess and works for me now.

Original .htaccess:

# Rewrite JavaScript callback URLs of the form js.php?q=x.
RewriteCond %{REQUEST_URI} ^\/([a-z]{2}\/)?js\/.*$
RewriteRule ^(.*)$ js.php?q=$1 [L,QSA]
RewriteCond %{QUERY_STRING} (^|&)q=((\/)?[a-z]{2})?(\/)?js\/.*
RewriteRule .* js.php [L]

New.htaccess:

# Rewrite JavaScript callback URLs of the form js.php?q=x.
RewriteCond %{REQUEST_URI} !^/js/admin_menu/cache/.*$ 
RewriteCond %{REQUEST_URI} ^\/([a-z]{2}\/)?js\/.*$
RewriteRule ^(.*)$ js.php?q=$1 [L,QSA]
RewriteCond %{QUERY_STRING} (^|&)q=((\/)?[a-z]{2})?(\/)?js\/.*
RewriteRule .* js.php [L]
alexweber’s picture

You can also avoid this problem entirely by disabling the admin menu local cache option (admin_menu_cache_client) in the admin menu config page.

joelpittet’s picture

Status: Active » Reviewed & tested by the community

Thanks for the updated .htaccess rewrite changes. That did the trick in #1.

joelpittet’s picture

Whoops should have tested better.

  # Rewrite JavaScript callback URLs of the form js.php?q=x.
  RewriteCond %{REQUEST_URI} !^\/([a-z]{2}\/)?js\/admin_menu\/cache\/.*
  RewriteCond %{REQUEST_URI} ^\/([a-z]{2}\/)?js\/.*
  RewriteRule ^(.*)$ js.php?q=$1 [L,QSA]
  RewriteCond %{QUERY_STRING} (^|&)q=((\/)?[a-z]{2})?(\/)?js\/.*
  RewriteRule .* js.php [L]

This catches the multilingual 2 character prefix and escapes the slashes. the $ at the end is superfluous.

excel28’s picture

Hello,

I have an issue where my .htaccess has a custom redirect to index.php.
#RewriteRule ^ index.php [L] <--- original
RewriteRule ^(.*)$ index.php?q=$1 [L,QSA] <--- my custom redirect

I used the rewrite conditions from comment 4, but it seems to fail.

Can you help?

tripper54’s picture

Status: Reviewed & tested by the community » Needs review
FileSize
911 bytes

Patch attached that adds the admin_menu specific line to the auto-generated htaccess code.

markhalliwell’s picture

Status: Needs review » Closed (outdated)