When editing the settings for my Zen sub-theme via admin/appearance/settings/[subtheme] the "Append a separator to the end of the breadcrumb" does not stay unchecked when unchecking the checkbox and saving the sub-theme's settings. Every time I edit the sub-theme settings, I have to remember to uncheck the checkbox. Please note, unchecking the checkbox and saving the sub-theme settings works correctly, the trailing separator is removed, but when the settings form is redisplayed, the checkbox is checked again and resaving the settings will cause the trailing separator to appear.

Comments

dave reid’s picture

Status: Active » Fixed

You likely have it hard-coded in the .info file of your sub-theme. You'll need to set that value to '0' or remove it from the subtheme's .info to be able to change it in the UI.

christian deloach’s picture

Dave - thank you for the response. I'll investigate that to see if that addresses my issue. Out of curiosity, what's the purpose of having the settings in the .info and the appearance maintenance form? Is that standard for all themes/sub-themes?

I appreciate your time in responding to my post.

Status: Fixed » Closed (fixed)

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

dagomar’s picture

Status: Closed (fixed) » Active

I have this issue. Has anyone solved this?

christian deloach’s picture

Hi dagomar,

I've forgotten all about this issue. I haven't used breadcrumbs in my latest Drupal projects. I haven't found a fix for this issue and the issue still persists. Following Dave's suggestions didn't solve the problem. I believe the issue relates to Drupal's form API. I'm not too familiar with Drupal's form API but I'm guessing that when zen_breadcrumb_trailing field is setup in the theme-settings.php file, the #states control configures the checkbox to check and uncheck based on the checked state of the zen_breadcrumb_title field. This automatically adds javascript to change the state of the zen_breadcrumb_trailing checkbox based on the checked state of the zen_breadcrumb_title. I suspect the state controls must be automatically triggered on page load so if the zen_breadcrumb_title is unchecked on page load, the zen_breadcrumb_trailing is automatically checked regardless of the value supplied to the #default_value, i.e. theme_get_setting('zen_breadcrumb_trailing'). You can confirm my theory by disabling javascript on your browser. Disabling javascript causes the form to work as expected, "Append a separator to the end of the breadcrumb" is checked based on the last saved setting. Enabling javascript causes the "Append a separator to the end of the breadcrumb" to always be checked if "Append the content title to the end of the breadcrumb" is unchecked.

Again, I haven't work much with the form API but to me it looks like the issue is with the form API rather than the Zen sub-theme. The Zen sub-theme setups up the zen_breadcrumb_trailing checkbox to uncheck and disable when the zen_breadcrumb_title is checked. However, I suspect this also reverses the states automatically so if zen_breadcrumb_title is unchecked, the reverse happens, zen_breadcrumb_trailing is checked and enabled. Since the form API includes both checked and unchecked (and disabled/enabled) state controls I would have thought reversing the states would not have been automatic but something that should be defined by the developer to have more control so instead of automatically setting up zen_breadcrumb_trailing to be checked and enabled when zen_breadcrumb_title is unchecked, required the developer to specified an enabled state and exclude the checked state if the checkbox should not be automatically checked.

johnalbin’s picture

Status: Active » Closed (duplicate)