Hi all,

I'm configuring Domain Access for a site and the message "This form is domain-sensitive, be sure you select the proper domain before saving" on _every_ page user page (what I logged in as #1 user) and on every admin page.

I found this is pretty irritating and see no reason of such behavior.
Any ideas?

Comments

OnkelTem’s picture

Component: User interface » - Domain Settings

I found in code, that in domain_settings/domain_settings.module every form which is altered is having this message:

function domain_settings_form_alter(&$form, $form_state, $form_id) {
  global $_domain;

  // Remove settings that cannot be used reliably.
  $disallow = domain_settings_disallow();
  if (!user_access('access domain settings form') || in_array($form_id, $disallow) || !isset($form['#submit']) || !in_array('system_settings_form_submit', $form['#submit'])) {
    return;
  }
  // Set our drop down's weight to be one lighter than the submit button's,
  // ensuring that it always appears right above it (assuming nobody else
  // form_alter()s us out.)
  drupal_set_message(t('This form is domain-sensitive, be sure you select the proper domain before saving.'), 'warning', FALSE);
...

The reason why this appears on EVERY page for me, is new Admin 2.0 module ( http://drupal.org/project/admin ), which outputs a panel to the left, with "Create content" tab, which has a form with id="admin-block-theme-form":

<form action="/"  accept-charset="UTF-8" method="post" id="admin-block-theme-form">

So. Seeing the message about a domain-sensitive form, when there are no any visible forms, is not cool. I think a special condition should be added to the above code to hide the message in similar cases. Let me check is it available via $disallow...

==

Well, I successfully hid the message by adding the form with ID "admin_block_theme_form" to $disallowed list on the Domain Settings configuration page: admin/build/domain/settings in "Domain-specific settings" tab.

I think this should be by default (to move this form to disallowed list), but not sure which module should be concerned with this - Domain Settings or Admin module.

agentrickard’s picture

Status: Active » Closed (won't fix)

It's a flaw in the design of admin module for adding system_settings_form to every page. Not my problem. Your fix is the correct one. That's why those settings are there.

agentrickard’s picture

Status: Closed (won't fix) » Needs review

Right now, Admin module cannot really address this. We could add a hook_domain_settings_alter() or hook_domain_settings_ignore() to allow other modules to change the disallowed list, or Admin module could edit the 'domain_settings_ignore' variable.

But something like this was bound to happen. Not much we can do aside from that. And I generally refuse to hard-code in special rules for non-core modules.

agentrickard’s picture

Status: Needs review » Closed (won't fix)
prakash4php’s picture

Still i have showing same error on "admin/build/domain/roles" page. that why i am not able to give permission to particular domain

charlie-s’s picture

Perhaps this message could be disabled for users who already know this and don't need the message.

D'oh, this is easily achieved. Do something like "only show on the following forms" and don't enter any forms.

darrellduane’s picture

In Drupal 7 the page to go to to do this is /admin/structure/domain/settings. Thanks for this solution!