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

Comments

anneke_vde created an issue. See original summary.

anneke_vde’s picture

Status: Active » Needs review
StatusFileSize
new892 bytes

Attached 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.

guardiola86’s picture

StatusFileSize
new1.48 KB

This patch checks if there's an existing alias for the domain id. If there's already one, "Generate automatic URL" will be disabled.

guardiola86’s picture

Sorry, just saw you published one patch anneke_vde, I'll give it a try.

guardiola86’s picture

@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.

anneke_vde’s picture

@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.

guardiola86’s picture

I had the setting "'Do nothing. Leave the old alias intact.'" enabled, yet it was creating new aliases when changing the title.

fwust’s picture

#2 is working fine

mably’s picture

Status: Needs review » Postponed (maintainer needs more info)

Problem should have been fixed by this issue, can you confirm?

#3530964: Enable Pathauto automatically when a pattern is defined

mably’s picture

Unless new, valuable information is provided, this issue will be closed in a few weeks.

mably’s picture

Status: Postponed (maintainer needs more info) » Closed (outdated)

Problem is most probably fixed in latest 2.0.0-alpha5 release.

Now that this issue is closed, review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, credit people who helped resolve this issue.