When editing a text format, every single settings form by every module that provides filters is displayed in the vertical tabs list.

This is both cluttered and in some cases misleading to users: For example, even though the "Plain text" format uses a filter to disallow all HTML elements, the presence of the "Allowed HTML tags" setting falsely implies otherwise. Changing settings for inactive filters have absolutely no effect on the format, and having non-operational/irrelevant controls is bad design.

The only upside to having them is that users can activate a filter and configure it at the same time, without submitting the form twice. Is this really worth the confusion?

Comments

cburschka’s picture

Oh wait. I just realized the Javascript code is in fact intended to toggle the visibility of the tab, much like it is supposed to do for the reordering table. It just doesn't work properly.

It also doesn't work fully in the reordering table, by the way - some of the filters are still listed even though they're inactive.

cburschka’s picture

Update: The event that does this is in fact not attached to most of the filter checkboxes.

      $checkbox.bind('click.filterUpdate', function () {
        alert("Clicked");
        if ($checkbox.is(':checked')) {
          $row.show();
          if (tab) {
            tab.tabShow().updateSummary();
          }
        }
        else {
          alert("Hiding!");
          $row.hide();
          if (tab) {
            tab.tabHide().updateSummary();
          }
        }
        // Restripe table after toggling visibility of table row.
        Drupal.tableDrag['filter-order'].restripeTable();
      });

"Clicked" and "Hiding" will be displayed when unchecking the very first checkbox, "Limit allowed HTML tags", but neither are displayed on the rest.

cburschka’s picture

The problem is caused by this snippet:

      // Attach summary for configurable filters (only for screen-readers).
      if (tab) {
        tab.fieldset.setSummary(function (tabContext) {
          return $checkbox.is(':checked') ? Drupal.t('Enabled') : Drupal.t('Disabled');
        });
      }

The function "setSummary" does not exist; execution terminates before any of the other elements get their event listeners attached.

cburschka’s picture

Title: Filter settings displayed for non-used filters » Calls to setSummary() must be renamed to drupalSetSummary()
Component: filter.module » javascript
Priority: Normal » Critical
Status: Active » Needs review
StatusFileSize
new2.3 KB

This, in turn, is caused by #445130: Namespace the Drupal jQuery functions not being sufficiently reviewed, as the function renaming of setSummary to drupalSetSummary leaves four outdated calls in three modules: book, filter and comment. This patch fixes all four.

Updating title/component, also upgrading to critical since javascript execution is broken by this and it affects several modules.

This sleuthing is really more fun than it should be. (Unfortunately, I've now blown my Drupal time today on this. :/ )

jpmckinney’s picture

Status: Needs review » Reviewed & tested by the community

Indeed. Silly rabbits.

jpmckinney’s picture

Status: Reviewed & tested by the community » Closed (duplicate)