Drupal 7.2 with Domain Access 7.x-2.12 and Piwik 7.x-2.1 installed (literally a fresh install).

Not sure whether this is a Domain Access issue or from the Piwik module, so please feel free to reassign.

When assigning the settings for my primary domain in Piwik configuration, under Domain-specific settings, Save settings for domain I use "
" instead of "All domains". However when I save this saves the configuration for all domains.

I then go into my other domain and this works properly when choosing the particular domain. Going back and configuring the primary domain overwrites the settings from my other domain.

I can recreate this as well when trying to configure for my primary domain from my second domain.

Comments

wuffers’s picture

Title: Piwik does not respect Domain Access setting for domain when it is done from primary domain » Domain Access saves for "All domains" when selecting primary (default) domain from Domain-specific settings
Project: Piwik Web Analytics » Domain
Version: 7.x-2.1 » 7.x-2.12
Issue tags: -piwik

Okay, changing the project as it seems this is unrelated to the Piwik module. Had the same issue appear for all configuration settings. Also renamed title.

This is a very clean install with a fresh database, one article entry and two contrib modules: Piwik and Google Analytics. I then tried changing some things in core modules (Logging) and whenever I choose "[primary/default domain]" or "All domains" to save to, it applies the changes to all domains. If I use my secondary domain (and I only have two configured) DA works properly.

Am I missing something? I'm about to try the dev branch to see if that is a fixed issue.

wuffers’s picture

Okay, after running:
drush dl domain-7.x-3.x-dev --verbose

This runs through and installs into the /sites/all/modules/domain with a [success]. Trying to do an update (drush up) afterwards, I get:

WD php: PDOException: SQLSTATE[42S22]: Column not found: 1054 Unknown[error]
column 'weight' in 'field list': SELECT domain_id, subdomain,
sitename, scheme, valid, weight, is_default FROM {domain} WHERE
is_default = 1; Array
(
)
in domain_default() (line 1031 of
/../public_html/sites/all/modules/domain/domain.module).
PDOException: SQLSTATE[42S22]: Column not found: 1054 Unknown column 'weight' in 'field list': SELECT domain_id, subdomain, sitename, scheme, valid, weight, is_default FROM {domain} WHERE is_default = 1; Array
(
)
in domain_default() (line 1031 of /../public_html/sites/all/modules/domain/domain.module).
Drush command terminated abnormally due to an unrecoverable error. [error]

Trying to navigate to either of my domains (big blank page with only the following):
---
Additional uncaught exception thrown while handling exception.
Original

PDOException: SQLSTATE[42S22]: Column not found: 1054 Unknown column 'weight' in 'field list': SELECT domain_id, subdomain, sitename, scheme, valid, weight, is_default FROM {domain}; Array ( ) in domain_lookup() (line 977 of /../public_html/sites/all/modules/domain/domain.module).
Additional

PDOException: SQLSTATE[42S22]: Column not found: 1054 Unknown column 'weight' in 'field list': SELECT domain_id, subdomain, sitename, scheme, valid, weight, is_default FROM {domain}; Array ( ) in domain_lookup() (line 977 of /../public_html/sites/all/modules/domain/domain.module).
---
And even worse.. drush is stuck, and renaming the domain module folder got me more errors so I had to put the recommended release back via FTP.

Now the site comes up, but I get an error:

PDOException: SQLSTATE[42S22]: Column not found: 1054 Unknown column 'weight' in 'field list': SELECT domain_id, subdomain, sitename, scheme, valid, weight, is_default FROM {domain}; Array ( ) in domain_lookup() (line 977 of /../public_html/sites/all/modules/domain/domain.module).

Refreshing the page seems to work, and I had to do it to both sites. Still having the original issue though.

My bad on not reading Differences between 7.x.2 to 7.x.3. Didn't realize there was a refactoring going on.

wuffers’s picture

Okay, I reproduced the bug on a fresh Drupal 7.2 install with just Domain Access 7.x-2.12 installed.

After a complete uninstall (this seems to be key since upgrading from 7.x.2 to 7.x.3 does NOT work) and then installing the dev branch seems to have fixed it.

agentrickard’s picture

Status: Active » Closed (cannot reproduce)

Please start over in a new issue. This is impossible to understand.

7.x.3 is neither stable nor supported.

You may also just be misunderstanding Domain Setttings. If you haven't set a variable for a custom domain, it _inherits_ from the primary.

agentrickard’s picture

Issue tags: -domain access

Removing redundant tag.

wuffers’s picture

Status: Closed (cannot reproduce) » Active

DA 7.x.3 works for me so I'm only posting to help out with this issue. My use of "primary" and "other" domain above probably wasn't very clear, so I'll give better examples below to clear out the confusion.

Fresh Drupal 7.2 install, literally the first module I install is DA.

I then put the reference for settings.inc into settings.php, enable the module and rebuild the permissions. Life seems good at this point.

I create a new domain: xyz.com, while abc.com is my primary.

I was testing this out trying to change Logging and Errors settings. If I choose "abc.com" (my default domain) and save, the page comes back with "The configuration options have been saved for all domains". The same happens if I choose "All domains". If I choose "xyz.com" then the page correctly comes back with "The configuration options have been saved for xyz.com".

agentrickard’s picture

Thanks.

agentrickard’s picture

Status: Active » Needs review

This is technically "by design" but I can see how it is confusing. The code in question is:

  // Set a message about the affected domains.
  if ($domain_id > 0) {
    $domain = domain_lookup($domain_id);
    $affected = $domain['sitename'];
  }
  else {
    $affected = t('all domains');
  }

This is due to the fact noted in #4. We should probably clean this up.

Suggestion:

-- On saving for 'all domains':

"The configuration options have been saved for all domains"

-- On saving for the primary domain:

"The configuration options have been saved for the primary domain; these settings will be inherited unless overridden per domain."

-- On saving other domain:

"The configuration options have been saved for DOMAIN NAME".

This behavior works "correctly" in 7.x.3 because the domain 0 reference hasn't been removed from the code.

agentrickard’s picture

Status: Needs review » Reviewed & tested by the community
StatusFileSize
new1.01 KB

Patch committed to 7.x.3.

agentrickard’s picture

StatusFileSize
new1.06 KB

Committed to 7.x.2.

agentrickard’s picture

Status: Reviewed & tested by the community » Fixed
StatusFileSize
new1.39 KB

Committed to 6.x.

Status: Fixed » Closed (fixed)

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