Problem/Motivation

A bit like described in the Drupal 7 Alias Lock Module we often run into the situation that we have certain "static" content types, whose URL-aliases should be automatically created by pathauto, but never changed afterwards.
Of course this could be done manually by the author, but typically the content creators are no technical experts and tend to forget unchecking the "Generate automatic URL alias" after creating the node.

Typically, this is the case for nodes, which are an essential part of the menu structure or even more important, are parent paths to other URLs in a tree folder structure.

It would be nice to have an option, presumably on the pattern form (/admin/config/search/path/patterns/{CONTENT-TYPE}) to set this behavior.

Steps to reproduce

  1. Create an url pattern for nodes (e.g. page) with dynamic parts like [node:title]
  2. Create a node with a static nature (e.g. page) node, with automatic alias generation turned on. Let's set the title "My title"
  3. See the URL alias generated properly: /my-title
  4. Edit the node and change the title to "My new title" without thinking about the results in the URL and have /my-new-title generated as new title without noticing it
  5. Argue about the wrong url structure and unwanted redirects, because "the only thing you wanted to to is changing the title" ;)
  6. Hope for an automatic solution, locking the URL after first creation by automatically unchecking "Generate automatic URL alias".

:)

Proposed resolution

Add an option to the pattern create / edit form (/admin/config/search/path/patterns/{CONTENT-TYPE})

Remaining tasks

  1. Discuss
  2. Implement
  3. Write tests
  4. Rewiew
  5. Release

User interface changes

API changes

Data model changes

Comments

Anybody created an issue.

anybody’s picture

@Maintainers: What do you think about this? If you'd be fine with that, we'd start the implementation. :)

mably’s picture

Could be an interesting feature to have.

Some kind of "Auto generate once only".

Having that pattern flag would mean to toggle off the state after an automatic path alias generation.

anybody’s picture

In the meantime I found https://www.drupal.org/project/node_keep

Maybe it should be linked on the module page. Looks like it solves this use-case?

mably’s picture

I think this feature could be implemented in-house.

We just need to find the right UX for it.