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.
When you edit an existing domain record and change its machine name, the validation fails saying that the hostname already exists.
Steps to reproduce:
- Create a domain record
- Try to edit the domain record and change its machine name
- You are unable to save the domain record
A workaround is editing the domain record changing its hostname temporarily to something else at the same time you change the machine name then editing again to change back the hostname to its original value.
Comment | File | Size | Author |
---|---|---|---|
#4 | 2869197-domain-machine_name.patch | 2.29 KB | agentrickard |
Comments
Comment #2
agentrickardA statement of the exact error message would be helpful, otherwise, this is a great report.
Comment #3
agentrickardHere is the problem code:
I think we can get around this by checking the domain_id() value, which is not editable.
I'll roll a patch in a minute.
Comment #4
agentrickardHere's a patch.
We were also checking this logic in Domain::preSave(), which was a precaution for auto-generated domains, but I think it is not needed.
Comment #5
agentrickardCommitted.