Problem/Motivation

Blocked on https://git.drupalcode.org/project/forum/-/work_items/3584933

Steps to reproduce

Proposed resolution

Remaining tasks

User interface changes

API changes

Data model changes

Issue fork pathauto-3608383

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

berdir created an issue. See original summary.

berdir’s picture

Status: Active » Needs review
csakiistvan’s picture

Assigned: Unassigned » csakiistvan
csakiistvan’s picture

Assigned: csakiistvan » Unassigned
Status: Needs review » Reviewed & tested by the community
StatusFileSize
new243.34 KB
new254.62 KB
new203.4 KB

Environment

  • Drupal: 11.4.4
  • PHP: 8.5.5
  • Database: MariaDB 10.11.16
  • DDEV: v1.25.2
  • Pathauto: 1.15.0
  • Forum: 1.1.3 (contrib)
  • Browser: Chrome

Prerequisites

  • Drupal 11 site with drupal/pathauto:1.15.0 installed.
  • Contrib forum installed and enabled, since forum is no longer in core:
    ddev composer require 'drupal/forum:^1.1'
    ddev drush en forum -y
  • A pathauto pattern of type Forum with the pattern /forums/[term:name].
  • The default General discussion forum term (created by the forum module) with a generated alias /forums/general-discussion.
  • No pattern of type Taxonomy term exists, so the forum pattern is the only one that can apply to forum terms.

Steps

  1. Apply the fix from MR !182: remove the Forum alias type plugin from pathauto, drop the drupal/forum dev requirement in favour of a version constraint, and drop forum coverage from the bulk update test.
  2. Rebuild caches: ddev drush cr
  3. Go to Configuration > Search and metadata > URL aliases > Patterns > Add Pathauto pattern (/admin/config/search/path/patterns/add) and open the Pattern type select.
  4. Go to /admin/config/search/path/patterns and look at the existing forum pattern.
  5. Re-save the General discussion forum term and check whether an alias is generated.
  6. Additionally apply the companion plugin from forum MR !38 (forum#3584933), rebuild caches, and repeat steps 3 to 5.

Expected results

  • With MR !182 alone, pathauto no longer offers a Forum pattern type and no longer ships any forum-specific plugin.
  • Existing patterns of type Forum fall back to Broken type instead of throwing a fatal error.
  • Once forum contrib provides the plugin (forum MR !38), the Forum pattern type is available again and forum term aliases are generated exactly as before the removal, with unchanged pattern configuration and unchanged alias values.

Actual results

Before the fix, pathauto provided the Forum alias type itself: Forum was listed in the Pattern type select, the forum pattern generated /forums/general-discussion for the default forum term, and that alias resolved in the browser. After applying MR !182, Forum was gone from the select, the pre-existing forum pattern was shown as Broken type, and re-saving the forum term produced no alias — as expected, since nothing provides the plugin at that point. After additionally applying forum MR !38, the pattern type read Forum again, the same pattern configuration was reused without any change, and re-saving the term regenerated /forums/general-discussion identically to the pre-fix baseline. No errors were logged in any of the three states.

Notes for the maintainer

  • This confirms the "blocked" status: sites with an active Forum pattern lose forum term aliases in the window between the pathauto release and a forum release carrying the plugin. Coordinating the releases (or the added drupal/forum conflict constraint) covers this.
  • PathautoGenerator::updateEntityAlias() still contains forum-specific handling that reads forum.settings and overrides $type to forum for terms in the forum vocabulary, together with a @todo Update and test forum related code comment. It is harmless today because $type is only used for the child-term recursion, but it is leftover forum coupling that this issue arguably should also remove.

Testing produced with the assistance of an LLM.