When Zen or a Zen-based theme is set to automatically rebuild the theme registry on each request, it displays the warning "The theme registry has been rebuilt. Turn off this feature on production websites.", with "Turn off" rendered as a link. When running with Clean URLs disabled, this link is broken.

The generated href: http://localhost/admin/build/themes/settings/zen
The expected href (if no clean URLs): http://localhost/index.php?q=admin/build/themes/settings/zen or http://localhost/?q=admin/build/themes/settings/zen

I have this problem with my Zen-based theme on Drupal 6.4 as well as on a clean Drupal 6.6 + Zen 6.x-1.0-beta3 installation, running on Vista + IIS 7.
The problem seems to be located in "template.theme-registry.inc" at line 63. I rewrote this line so it uses the l() function instead of the base_path()-function, and this fixes the problem on my end.

Before

drupal_set_message(t('The theme registry has been rebuilt. <a href="!link">Turn off</a> this feature on production websites.', array('!link' => base_path() . 'admin/build/themes/settings/' . $GLOBALS['theme'])), 'warning');

After

drupal_set_message(t('The theme registry has been rebuilt. !link this feature on production websites.', array('!link' => l(t('Turn off'), 'admin/build/themes/settings/' . $GLOBALS['theme'])) ), 'warning');

My environment is currently not set up to easily generate patch files, and I am unable to verify that this change works on installations with Clean URLs enabled, so I'd be greateful if someone else could take a look and maybe create the patch file?

Thanks,
Mr. Baileys

CommentFileSizeAuthor
#1 zen_broken_link.patch855 bytesmr.baileys
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

mr.baileys’s picture

Version: 6.x-1.0-beta3 » 6.x-1.x-dev
Status: Active » Needs review
FileSize
855 bytes

Here's a patch against 6.x-1.x-dev to fix the broken link.

Bevan’s picture

This will need rerolling after #322480: Make registry rebuild warning less obtrusive gets committed.

JohnAlbin’s picture

Title: Broken link in "Theme Registry Rebuilt"-warning when Clean URL's are disabled » Broken link in "Theme registry rebuilt" warning when Clean URLs is off
Status: Needs review » Fixed

You shouldn't split up the text like this in a t() function. It makes it impossible to translate into other languages.

But, yes, the link is broken when Clean URLs is off. I should be using url().

Thanks for the bug report, mr.baileys!

Status: Fixed » Closed (fixed)

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