Propose changing user profile routes to avoid conflicting parameter

Created on 20 November 2024, 6 months ago

Problem/Motivation

I ran into an issue the other day with profile after I installed profile. I have existing custom route /user/{user}/inbox that responds to a specific format and POST method only, which suddenly were returning 404 because of the parameter casting in profile.user_page.single and profile.user_page.multiple routes using the pattern /user/{user}/{profile_type}.

In the end I had to alter the routes for profile to be /user/{user}/profile/{profile_type} so that my other custom routes would work again.

This could be more of a feature request than a bug.

Steps to reproduce

1. Create a custom module that defines a route with path /user/{user}/inbox, which could be limited to POST and/or json formats as an example.
2. Install profile module.
3. Create a default profile.
4. Attempt a request to the route path in 1. and get a 404.

Proposed resolution

TBD

Remaining tasks

  • Write a functional test with a test-only module to help reproduce.
  • Come up with a proposed resolution:
    1. Change the routes so that the {profile_type} parameter does not immediately follow the {user} parameter. Provide a means of informing users of the change.

User interface changes

Route path changes?

API changes

Route path changes could affect hard-coded paths in custom modules, themes, views that may not be possible to detect?

Data model changes

🐛 Bug report
Status

Active

Version

1.0

Component

Code

Created by

🇺🇸United States mradcliffe USA

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

Merge Requests

Comments & Activities

  • Issue created by @mradcliffe
  • Pipeline finished with Failed
    6 months ago
    Total: 163s
    #344707
  • Pipeline finished with Failed
    6 months ago
    Total: 254s
    #344715
  • Pipeline finished with Success
    6 months ago
    Total: 163s
    #344720
  • 🇺🇸United States mradcliffe USA

    I don't think this is RTBC, but I wanted to show red-green test runs.

  • Status changed to Needs review 3 months ago
  • 🇮🇱Israel jsacksick

    I think this change makes sense but don't know if we can consider this a breaking change or not.

  • 🇺🇸United States mradcliffe USA

    Unfortunately it is a breaking change. The best we can do is update menu_link_content, path_alias and views. I think any other custom module or contrib module is out-of-scope.

    Propose:

    - hook_update_N to update menu_link_content entity (if menu_link_content installed)
    - Maybe add a path alias for every menu_link_content entity affected (if path_alias installed)
    - hook_update_N to update any path alias entity (if path_alias installed)
    - post update to update view configuration (if views installed)
    - Change record + release notes

    This could be done in a new 2.0.x branch.

Production build 0.71.5 2024