Problem/Motivation
After #3374263: domain_path_pathauto defaults to disabled the domain_path_pathauto defaults to enabled.
When you disable the domain_path_pathauto setting the state is deleted, next time you load the form the value isset to enabled again because that is the default.
// Delete pathauto default enabled setting.
$this->domainPathautoGenerator->deleteDomainPathPathautoState($entity, $domain_id);
Steps to reproduce
- Create a node
- Disable domain_path_pathauto for domain A
- Save the node
- Edit the node again, the domain_path_pathauto checkbox for domain A is enabled again
Proposed resolution
Instead of deleting the pathauto setting, save the setting with value FALSE so next time you load the form the checkbox is still disabled
Remaining tasks
User interface changes
API changes
Data model changes
| Comment | File | Size | Author |
|---|---|---|---|
| #3 | 3388296-2-disabled-domain-path-not-saved.patch | 1.48 KB | guardiola86 |
Comments
Comment #2
anneke_vde commentedAttached is the patch of the proposed solution. Instead of deleting the state of the domain_path_pathauto setting the setting is saved as FALSE so the checkbox stays disabled when saving the node.
Comment #3
guardiola86 commentedThis patch checks if there's an existing alias for the domain id. If there's already one, "Generate automatic URL" will be disabled.
Comment #4
guardiola86 commentedSorry, just saw you published one patch anneke_vde, I'll give it a try.
Comment #5
guardiola86 commented@anneke_vde if I create a content, it generates an alias. If I edit again, the checkbox "Generate automatic URL alias" is checked, although it doesn't generate URLs with '-0' at the end. But if you change the title, the alias is updated.
In my case, I need the alias to stay the same, even if I change the title.
Comment #6
anneke_vde commented@guardiola86 the pathauto module has a setting for if you want the alias to be the same 'Do nothing. Leave the old alias intact.'.
I tested this but on my local dev it doesn't work. In the module code of domain path I see code for it: UPDATE_ACTION_NO_NEW.
Maybe better to create a new issue for that, this issue is about the setting not being saved.
Comment #7
guardiola86 commentedI had the setting "'Do nothing. Leave the old alias intact.'" enabled, yet it was creating new aliases when changing the title.
Comment #8
fwust#2 is working fine
Comment #9
mably commentedProblem should have been fixed by this issue, can you confirm?
#3530964: Enable Pathauto automatically when a pattern is defined
Comment #10
mably commentedUnless new, valuable information is provided, this issue will be closed in a few weeks.
Comment #11
mably commentedProblem is most probably fixed in latest 2.0.0-alpha5 release.