Domain needs a domain record with ID=0.
The same issue is also known from anonymous user with ID=0.

There are some migration tools that destroy data integrity because inserting an undefined (NULL) record leads to creation of an autoincrement index.
Thus there's some risk that the default domain gets an arbitrary next autoincrement value and default domain with ID=0 is missing.

Missing default domain leads to complete misbehaviour and especially redirection loops on settings forms like
/admin/structure/domain/edit/$ID

I suggest to add a hook_requirements to check if the record exists.

Do you support this?

Comments

agentrickard’s picture

Yes. We also need this for 7.x.3, which does away with domain 0 and needs to check that the update ran properly.

agentrickard’s picture

StatusFileSize
new5.94 KB

Patch for 7.x.3 requirements. We need something different for 7.x.2.

agentrickard’s picture

Status: Active » Needs work

Needs a test and a drush command.

agentrickard’s picture

StatusFileSize
new6.97 KB

And the patch with a drush command (domain-repair).

agentrickard’s picture

Status: Needs work » Patch (to be ported)
StatusFileSize
new11.83 KB

Here's a working patch (with drush and tests) that can be used for a stable upgrade process. It has been committed.

Needs a rewrite for the 7.x.2 branch, if we want the original feature.

agentrickard’s picture

StatusFileSize
new21.78 KB
new11.18 KB

Screenshots for use in docs.

miro_dietiker’s picture

Very nice progress.

agentrickard’s picture

It's not quite the same issue, but this technique can be used in 7.x.2 as well.

The original issue is not applicable to 7.x.3.

dqd’s picture

Issue summary: View changes
Status: Patch (to be ported) » Fixed

Here's a working patch (with drush and tests) that can be used for a stable upgrade process. It has been committed.

Status: Fixed » Closed (fixed)

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