Disabled domain_path_pathauto setting status not saved

Created on 19 September 2023, about 1 year ago
Updated 24 April 2024, 7 months ago

Problem/Motivation

After 🐛 domain_path_pathauto defaults to disabled RTBC 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

🐛 Bug report
Status

Needs review

Version

1.0

Component

Code

Created by

🇳🇱Netherlands anneke_vde

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

  • Issue created by @anneke_vde
  • Status changed to Needs review about 1 year ago
  • 🇳🇱Netherlands anneke_vde

    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 is stays disabled when saving the node.

  • 🇪🇸Spain guardiola86

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

  • 🇪🇸Spain guardiola86

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

  • 🇪🇸Spain guardiola86

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

  • 🇳🇱Netherlands anneke_vde

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

  • 🇪🇸Spain guardiola86

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

  • 🇫🇷France fwust Strasbourg

    #2 is working fine

Production build 0.71.5 2024