Consider a submodule to support pathauto

Created on 19 June 2025, about 1 month ago

Problem/Motivation

Now that 🐛 Node update hook is triggered upon group content create RTBC has landed, Pathauto might not update aliases anymore when an entity is added to or removed from a group. Consider a module group_support_pathauto to make sure aliases are still updated. Could also contribute this to Pathauto itself if they're willing to accept it.

Steps to reproduce

N/A

Proposed resolution

Discuss

Remaining tasks

TBD

User interface changes

N/A

API changes

N/A

Data model changes

N/A

Feature request
Status

Active

Version

4.0

Component

Code

Created by

🇧🇪Belgium kristiaanvandeneynde Antwerp, Belgium

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

Comments & Activities

  • Issue created by @kristiaanvandeneynde
  • 🇬🇷Greece vensires

    I am trying to identify what should be done and in which module...
    I scanned pathauto's code and it seems the only thing actually needed is the following code:

    \Drupal::service('pathauto.generator')->updateEntityAlias($entity, 'update');
    

    So, we could directly invoke this call with a proper if pathauto module exists then condition. The question already rose in #2872697-23: Stop saving an entity when it gets added to or removed from a group by @berdir but it's not yet clear what should be done exactly since this might affect other custom or contrib modules we're not currently aware of.

    I currently vote for a submodule for the pathauto implementation. It could event get installed by default as part of an upgrade if the module is enabled in the installation. This submodule could also work as a best-practice example for any other module to solve the same problem in its own context.

  • 🇧🇪Belgium kristiaanvandeneynde Antwerp, Belgium

    As mentioned in the other issue, it needs to be a standalone thing. We cannot privilege Pathauto over other contrib modules so it's best to leave any contrib module related code out of Group and put it into targeted submodules instead.

Production build 0.71.5 2024