Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
The domain id is now based on the hostname, which is not unique in all cases (for instance when using country_path):
public function createDomainId() {
// We cannot reliably use sequences (1, 2, 3) because those can be different
// across environments. Instead, we use the crc32 hash function to create a
// unique numeric id for each domain. In some systems (Windows?) we have
// reports of crc32 returning a negative number. Issue #2794047.
$this->domain_id = abs((int) crc32($this->getHostname()));
}
It should be based on id.
Comment | File | Size | Author |
---|---|---|---|
#8 | 2833053-domain-ids-8.patch | 3.06 KB | agentrickard |
#5 | domain-non-unique-identifier-2833053-5-D8.patch | 1.32 KB | jurcello |
#2 | domain-non-unique-identifier-2833053-2-D8.patch | 622 bytes | jurcello |
Comments
Comment #2
jurcello CreditAttribution: jurcello for Media.Monks commentedI would personally use the id because that needs to be unique anyway.
Patch added.
Comment #3
jurcello CreditAttribution: jurcello for Media.Monks commentedComment #4
jurcello CreditAttribution: jurcello for Media.Monks commentedI created a pull request:
https://github.com/agentrickard/domain/pull/296
Comment #5
jurcello CreditAttribution: jurcello for Media.Monks commentedAlso added an update hook in order to be able to update existing installations.
Comment #6
jurcello CreditAttribution: jurcello for Media.Monks commentedForget about the last patch: since the module is in alpha, the update hook is not needed.
Comment #7
agentrickardMy comments are in the PR. I think the update is warranted for people using the module in production, but I'd like to see if we can make it fire only if needed.
Perhaps check the domain_id against both methods and update if it isn't using id as a seed?
Comment #8
agentrickardHere's the patch version of PR 300.
https://github.com/agentrickard/domain/pull/300
Comment #9
agentrickardThis has been committed, but only to GitHub for the moment.
It will be in alpha 7.