I've just installed the Domain Access module with Drupal 5.7. I'm attempting to migrate from the Multidomain module. When I try to create a domain using the admin interface (the first domain I'm trying to create that isn't the default one), it doesn't appear in the list of domains (I presume it's supposed to), and all the domain* tables are completely empty.
Thoughts?
Comments
Comment #1
agentrickardI haven't upgraded to 5.7 yet. Is it possible that something broke in the 5.7 release?
What happens when you submit the form?
If you're not in production, you could try editing domain_admin.inc:
Then report back what it prints out.
Comment #2
wayland76 commentedWell, I haven't used it without 5.7, so I can't say :). But I can still edit at least some other things in the database with 5.7 (haven't tested exhaustively).
I presume your suggestion only referred to adding the 3 lines at the top (I couldn't see any other changes). I'm not 100% sure it's even getting to that function. I put in the code you suggested, but nothing appeared.
Comment #3
wayland76 commentedOh, and PHP 4.4.7 just in case it matters.
Comment #4
wayland76 commentedLooking in CVS, though, forms.inc doesn't appear to have changed since version 5.6.
Comment #5
wayland76 commentedIt appears that when domain_create is called in a submitted form, count($_POST) is 0. I doubt that's right.
Comment #6
agentrickardThat last comment makes no sense to me.
Try putting the debug code inside domain_create_form_validate().
Comment #7
agentrickardSome additional debugging steps:
-- Do other forms on your site work?
-- Have you configured the root domain?
-- From what domain is the "create domain" form loaded? (It should be the root domain.)
-- Do you have the module's "Search engine optimization" option turned on?
-- When viewing the HTML source on 'admin/build/domain/create', what is the form action?
Comment #8
wayland76 commentedOk, located the problem. I'd set the root domain to "jdarx.info". But it was being accessed as "www.jdarx.info". So it would send a 302 redirect, and then Firefox would do that, but it would do a GET instead of a POST. So suddenly none of the forms were working, not even the one that was supposed to let me change the domain root. So I went into the database using mysql, changed the domain_root in the "variable" table, ran "delete from cache where cid = 'variables' ", and then everything worked.
I think that, in writing the text of this module, we need to be careful to distinguish between the concepts "Domain Root" (in my case, "jdarx.info"), and "Primary Site" (in my case, "www.jdarx.info"). In particular, the text "The root domain for example.com. No http or slashes." on the Settings tab probably should be changed.
Comment #9
wayland76 commented(Oh, and credit where credit is due -- I tracked this with the Firefox module LiveHTTPHeaders)
Comment #10
wayland76 commentedOh, and to answer your questions:
- Other forms on the site worked before I configured the primary domain, but not after
- I had the root domain configured, but it should be called "Primary Site" (or possibly "Default Site", or "Master Site") instead, as I had it configured to something that didn't work
- I was loading it from the root domain
- I tried turning off the SEO thing, but didn't realise at the time that *all* forms were broken, so it was still on.
- When viewing the source, the form action pointed to the root domain that didn't work.
Comment #11
agentrickardThere is a "treat www.* as an alias of *" setting that should also solve this problem.
I'm not sure that changing the documentation as you suggest is any help here, as this is the first time this issue has come up.
If we changed the text, what would we change it to?
Comment #12
wayland76 commentedJust change the words "root domain" to "master domain" or "Primary Domain" or something.
Hmm. Actually, thinking about it, while I'm happy to manually edit the database, I'm not sure that it's very user-friendly :). Maybe the thing to do would be to make it so that the primary domain can only be set from that domain. So if you're administering from www.jdarx.info, you can only set the primary domain to:
a) Whatever it already is
b) www.jdarx.info
That might help keep us out of trouble :).
Comment #13
agentrickardConsidering that the primary domain or root domain for www.example.com is example.com, and any web server that is not configured to allow example.com to resolve is misconfigured, I'm really not going to agree with you here.
Look at the RFC for domains. www.* is the exception, not the rule. Or look at cookie handling. http://www.ietf.org/rfc/rfc2109.txt.
It starts with a dot because "example.com" is the root domain, and "*.example.com" is a valid subdomain. Changing the terminology here won't prevent user error.
The form field is already labeled "Primary domain," perhaps something more needs to be added in the README:
So I'm looking for a documentation suggestion here. Otherwise, it's a "won't fix."
Comment #14
agentrickardComment #15
wayland76 commentedI'm not sure I understand your arguments, and I see a place where I've been unclear.
For example, say I wanted to run two sites, example1.com and example2.com. One of those should be the "Primary Domain" listed in Domain Access; the default domain of those listed. But each is its own root domain. I guess what I'm saying is that, in my mind, "Primary Domain" and "Root Domain" are not the same thing, as the comment which refers to a "root domain" implies. I've been guilty of confusing the two in my previous comments.
You write: Considering that the primary domain or root domain for www.example.com is example.com, and any web server that is not configured to allow example.com to resolve is misconfigured, I'm really not going to agree with you here.
I'm not sure I understand. If I went to my equivalent, jdarx.info, it sends back a redirect. I'd consider that "resolving". But since the POST parameters don't get passed to the redirect, it doesn't work.
I agree changing the documentation probably isn't going to prevent the problem.
Comment #16
agentrickardThere may be a documentation issue, because it occurs to me that we changed the behavior at one point during development.
Originally, the module only allowed you to create subdomains. You set a root domain (example.com) and were expected to set the subdomains to be:
-- one.example.com
-- two.example.com
And so on.
However, during the testing process, we changed it to allow any domain to be entered. So "primary domain" is the preferred term. Now you can use:
-- example.com
-- myexample.com
-- one.example.com
You set the "primary domain" to be the fallback in case someone requests a domain that is not registered. This is used in cases where wildcard DNS is used.
So perhaps a documentation change is in order. We should at least make clear that the "Primary domain" must be accessible. But I'm still a little confused about what you set the Primary domain to.
Apparently, you should have set it to www.example.com, and the problem occurred because you set it to example.com, but your web server did not recognize that?
To me, that is a misconfiguration of the web server, and I won't take steps to prevent that error via code.
But I agree that is irrelevant, and will try to make the documentation consistent.
Comment #17
wayland76 commentedOk, just to clarify, I have 2 websites:
- www.example.com, which has Drupal on it
- example.com, which has only a .htaccess file doing a 301 redirect on it.
The web server recognised it, but then immediately tried to forward.
Thanks for the documentation change. That's mainly what I was after, I think.
The one that confused me was in domain/domain_admin.inc, line 135:
'#description' => t('The root domain for example.com. No http or slashes.')
The other one that might be confusing is domain/domain_user/domain_user.module, line 76:
'#description' => t('The root domain to user for usernames, typically example.com. No http or slashes.')
HTH,
Comment #18
agentrickardThat first one is a legacy issue, addressed in #16 and will be changed.
For the second, however, that language is accurate. When creating user-based domains, only the leftmost domain element can be created. That will be appended to the "root domain." This is a security feature so that users can't go crazy creating domain records.
So, in effect, if you let users create domains on "exampleuser.com" they are created at:
-- user1.exampleuser.com
-- user2.exampleuser.com
and so forth.
So the "root domain" concept is accurate there, I think. Perhaps you just want a longer description? But most people ignore those.
Comment #19
agentrickardI have added this description for "Primary domain":
And this to Domain User:
Comment #20
wayland76 commentedWonderful! Thanks.