When there's a path that is a subpath of trans_path, the getOutboundPath function messes up paths from other places

Created on 30 October 2024, 16 days ago

Problem/Motivation

We have a view that has the path "/program" and trans_path "/programmes".
When we generate path aliases with a path auto pattern that starts with "/programmes", the strReplaceFirst function in TvpProcessor causes our aliases to be mangled into "/programmes/blah".

Steps to reproduce

  • Create a view with the path "/program".
  • Translate that view to have the translated alias "/programmes".
  • Set up a path auto pattern to generate paths such as "/programmes/[blah]".

Proposed resolution

If we count the number of '/' in the original and translated paths when we do the check in "getOutboundPath", we would avoid this situation from occurring, as the rewriting of our patterns wouldn't happen unless there we have the same number of slashes in the $path and the $view_path["path"].

Remaining tasks

Write a few tests to ensure this change doesn't cause regressions and that as the module matures this issue doesn't reoccur.

User interface changes

None.

API changes

None.

Data model changes

🐛 Bug report
Status

Active

Version

1.1

Component

Code

Created by

🇳🇴Norway svenryen

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

Merge Requests

Comments & Activities

Production build 0.71.5 2024