When domain access settings are displayed in a vertical tab on the node edit form, the tab does not have a summary.

I think some useful information could be displayed in the tab summary, e.g.

  • All affiliates - when all affiliates is checked, regardless of remaining settings,
  • No affiliates - when all checkboxes are unchecked,
  • sub1.example.com - where exactly one domain is checked, and all-affiliates is unchecked,
  • 3 affiliates - multiple checkboxes are set, and all-affiliates is unchecked.

Patch to follow.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

andrewmacpherson’s picture

This patch does the following:

  • Adds domain.node.js, which provides the vertical tab summary.
  • Adds a class, domain-access-options-form, to the domain access settings fieldset. This follows the manner of the other vertical tabs on the node form, and is used by the JS behvaiour.
  • Refactors the FAPI declarations. There are now 3 properties which depend upon the domain_vertical_tab variable.
agentrickard’s picture

Yes please. Can we get a review or two?

justanothermark’s picture

The patch looks good except when the 'Domain selection format' (bottom of admin/structure/domain/settings) is set to select list rather than checkboxes.

I'm not sure if passing the value through Drupal.settings is the best way to handle this but the attached patch works whether checkboxes or a select list are used so should help us get to a final patch.

andrewmacpherson’s picture

Thanks Mark, I'll have a more detailed look at this tonight.

  • agentrickard committed ebc7d63 on 7.x-3.x
    Issue #2020611 by andrewmacpherson, justanothermark: Provide vertical...
agentrickard’s picture

Issue summary: View changes
Status: Needs review » Fixed

Committed.

Status: Fixed » Closed (fixed)

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

sepapp2’s picture

Category: Feature request » Bug report

If a user does not have access to all domains, and is not given the permission level to "Set domain access status for all content" then edit pages are giving the error message "Cannot read property 'fieldType' of undefined in relation to this line:
var fieldTypeSelector = (Drupal.settings.domain.fieldType == 0) ? ':checked' : ':selected';

If you give the user that permission level the vertical tab renders out without an error, but it gives them access to all domains and not just what they are assigned too.

agentrickard’s picture