Everytime i'm checking "Search box" in admin/build/themes/settings/garland and press save, the setting is lost after the save setting. The search box isn't displayed.

I'm using FX2 and D6-dev (29.09.2007)

Comments

hass’s picture

Title: "Search box" cannot activated » "Search box" unchecked in theme settings without explanation
Priority: Critical » Normal

I found the source. i haven't yet activated the search module. Aside it's not good to simply uncheck a box and do not tell the user about the problem. So we should add an drupal_set_message(, 'error') here with explanation.

theme.inc (Line 801 ff)

  // Only offer search box if search.module is enabled.
  if (!module_exists('search') || !user_access('search content')) {
    $settings['toggle_search'] = 0;
  }
hass’s picture

Or remove the "Search box" checkbox from the Theme setting until the search module becomes active.

dvessel’s picture

This should be fixed. I'm not sure of the cleanest way though. Doing a module_exists() sounds reasonable.

hass’s picture

I cannot see any patch committed in the last 5 days that have fixed this... which commit have fixed this?

dvessel’s picture

I said it *should* be fixed.

hass’s picture

No, it isn't - or how should this looks like with the patch?

jonfhancock’s picture

He's saying that it needs to be fixed.

floretan’s picture

Title: "Search box" unchecked in theme settings without explanation » theme settings form not disabling fields when corresponding modules are disabled
Assigned: Unassigned » floretan
Status: Active » Needs review

There was a mismatching key that caused conditionally enabled fields to be always enabled.

This patch actually changes 11 characters...

hass’s picture

What patch are you talking about? :-)

floretan’s picture

StatusFileSize
new862 bytes

oops... this one.

gábor hojtsy’s picture

This looks good, but let's update the comment too. We are not only disabling the search box here, but also other features (user picture on nodes and comments are also checked above). So let's use a comment appropriate:

// Disable form items for features not supported in this configuration.

Or something along these lines.

floretan’s picture

StatusFileSize
new997 bytes

Thank you for the suggestion. Here's a revised version of the patch.

The comment has been changed and moved down one line in order to match what the code really does.

gábor hojtsy’s picture

Status: Needs review » Fixed

Looks good, thanks, committed.

Anonymous’s picture

Status: Fixed » Closed (fixed)