I have enabled this module. Configured all on the taxonomy page and than tried to disable it later and unchecked the "Use custom display settings for the following view modes" > "Taxonomy term page" checkbox, but the display mode is still the previous configured one.

Repro:
1. I only set "Associated content display" to "hidden" in Taxonomy term page view mode, nothing else.
2. Uncheck the Taxonomy term page on Default view mode
3. Taxonomy Term page is still shown with "hidden" mode enabled.

I think this is wrong and should revert to core default as I have disabled it.

Comments

codycraven’s picture

Assigned: Unassigned » codycraven
Status: Active » Needs work

I agree, thank you for the report.

hass’s picture

It's not only the disable logic. I believe the module code runs all times, configured or not. This may waste performance.

I guess the check need to go into taxonomy_display_menu_alter(&$items), but I currently don't understand where to get a flag from; if this term is enabled for custom taxonomy displays or not.

codycraven’s picture

hass,

The simplest solution would be to replace in taxonomy_display_fetch_taxonomy_display():

This:

$result = db_select('taxonomy_display', 'td')
  ->fields('td')
  ->condition('machine_name', $machine_name)
  ->execute()
  ->fetchAssoc();

With this:

$result = FALSE;
if (condition to check if enabled) {
  $result = db_select('taxonomy_display', 'td')
      ->fields('td')
      ->condition('machine_name', $machine_name)
      ->execute()
      ->fetchAssoc();
}

Note that taxonomy_display does run on every taxonomy term page load. There's no way to selectively hook_menu_alter() on specific vocabularies.

lotyrin’s picture

Status: Needs work » Reviewed & tested by the community

I can confirm this. I agree that this is a usability issue.

I'm not concerned about any performance hit that checking like this will cause, it seems like it should be minor. If we find it's needed, we can add a layer of cache here at some point in the future.

codycraven’s picture

Status: Reviewed & tested by the community » Needs work

Still needs a patch to get RTBC.

codycraven’s picture

Version: 7.x-1.0 » 7.x-1.x-dev
Status: Needs work » Needs review
StatusFileSize
new794 bytes

Please review against 7.x-1.x.

lotyrin’s picture

Status: Needs review » Reviewed & tested by the community
lotyrin’s picture

Title: Configuration cannot disabled » Check for custom display setting before altering.
Priority: Critical » Major
Status: Reviewed & tested by the community » Fixed
lotyrin’s picture

Committed to 7.x-1.x

lotyrin’s picture

Status: Fixed » Active

While this is committed, it's introduced a problem.

On a fresh site, before any mode is either set or not set, field_view_mode_settings() will return an empty array. This causes a warning when we test for custom settings.

lotyrin’s picture

Title: Check for custom display setting before altering. » Follow-up: Check for custom display setting before altering.

Committed a fix.

lotyrin’s picture

Status: Active » Fixed

Also, now that this is in, anyone importing taxonomy_display settings via Features will also need to have exported their bundle settings for the vocabulary (this is a variable, so requires Strongarm) or have manually enabled the custom display for the exported taxonomy_display settings to have any effect.

codycraven’s picture

We should probably document the Features export process (including the strongarm and manual option) in a new child page of: http://drupal.org/node/1254876 before the 1.1 release.

Status: Fixed » Closed (fixed)

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