How to reproduce, on a Drupal clean install
- install Drupal 7 minimal profile
- download latest Domain Access 3.x-dev (drush dl domain-3.x-dev)
- enable Domain Access (drush en domain)
- copy include in settings.php (echo "include_once DRUPAL_ROOT . '/sites/all/modules/domain/settings.inc';" >> sites/default/settings.php)
- next query on Drupal site will loop on a 302 redirect

Regards,

David

Comments

agentrickard’s picture

Category: bug » support
Status: Active » Postponed (maintainer needs more info)

Not replicable. How is your DNS set up?

agentrickard’s picture

Status: Postponed (maintainer needs more info) » Closed (works as designed)

O, this is documented -- on drush en you must specify a URL parameter.

See http://drupal.org/node/1096956

This is because drush doesn't pass a proper HTTP_HOST for module setup.

David Stosik’s picture

You mean enabling the module via the interface, or any HTTP-called code (install profile for example), there won't be any problem ? I'll test that right now.

David Stosik’s picture

Right, this works. Thanks for the help. :)

agentrickard’s picture

Category: support » task
Status: Closed (works as designed) » Active

Not sure that there is a better solution to this, btw. It's something that only happens with drush, and so the documentation is the only workaround.

There should, however, be some error checking to ensure that we don't try to redirect users to the default domain if it isn't set correctly.

Perhaps exit the routine if {domain} is empty?

David Stosik’s picture

Fail the install if cannot find any domain, and throw a message intended to drush users, asking them to use --uri argument ?

agentrickard’s picture

Yup. We can do that.

Do you know what, if anything, was stored in the {domain} table when your install failed?

David Stosik’s picture

No line in the {domain} table. :)

David Stosik’s picture

Status: Active » Needs work
StatusFileSize
new2.87 KB

How about this ?
Using hook_requirements, phase=install, to test if $_SERVER['HTTP_HOST'] is set.
Messages needs to be refined.

agentrickard’s picture

Yeah, I like that!

David Stosik’s picture

Status: Needs work » Needs review
StatusFileSize
new2.9 KB

Better error message : re-use domain_valid_domain() error, and add appropriate advice for drush users.

agentrickard’s picture

StatusFileSize
new6.01 KB

Reviewed and refactored a bit. If we really want to run domain_valid_domain here, then get_t() is required.

The question is, should we enforce that behavior or merely ensure that $_SERVER['HTTP_HOST'] is set properly?

drush sets that value to 'default' if --uri is not specified.

agentrickard’s picture

Title: 302 infinite loop » Ensure proper installation via drush

Better title.

agentrickard’s picture

Status: Needs review » Fixed

Well, this doesn't break anything, and is itself untestable.

And since no one cares, I'm going to roll it into rc2 and see who cries.

Status: Fixed » Closed (fixed)

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