Help link broken on Modules page

Created on 27 March 2025, 3 months ago

Problem/Motivation

When clicking on the "Help" link on /admin/modules the link goes to an error page.

Steps to reproduce

  1. Install Project Browser as normal.
  2. Go to /admin/modules of your site.
  3. Search for Project Browser
  4. Click on Help link
  5. Message displayed is as follows: "The website encountered an unexpected error. Try again later."
🐛 Bug report
Status

Active

Version

2.0

Component

Code

Created by

🇺🇸United States anthonyroundtree

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

Comments & Activities

  • Issue created by @anthonyroundtree
  • First commit to issue fork.
  • @bhumikavarshney opened merge request.
  • 🇮🇳India Kanchan Bhogade

    Hi
    I have tested issue on Drupal 11.x

    Testing steps:

    1. Install Project Browser as normal.
    2. Go to /admin/modules of your site.
    3. Search for Project Browser
    4. Click on Help link, , issue reprodused
    5. Applied MR and check for the same

    After applied MR, the Help link broken on Modules page.

    Attaching screenshot

    Moving to Needs work

  • 🇺🇸United States chrisfromredfin Portland, Maine

    The issue here is line 24 of project_browser.module which is using Url::fromRoute to link to a route which now requires a parameter.

    I think the right thing here is to instead iterate over all enabled sources, and generate a link to each one:

          $output .= '<dd>' . t('Users who have the <em>Administer modules</em> can browse modules from the <a href=":project_browser_admin">Browse projects page</a>.', [':project_browser_admin' => Url::fromRoute('project_browser.browse', [])->toString()]) . '</dd>';
    

    So it says something like:

    Users who have the Administer modules ^permission can browse projects from the Extend section:

    • Contrib modules
    • Recipes

    Something like that.

  • First commit to issue fork.
  • 🇮🇳India libbna New Delhi, India

    The error occurred because the source parameter was missing when generating the route URL for project_browser.browse in the project_browser_help() function. I fixed this by explicitly passing 'source' => 'official' to Url::fromRoute(). After this change, the error no longer appears.

  • 🇮🇳India libbna New Delhi, India
  • Status changed to Needs review 22 days ago
  • 🇮🇳India Kanchan Bhogade

    Hi
    I have tested issue with MR on Drupal 11.x
    The MR is applied successfully...

    Help link working on Modules page.

  • 🇺🇸United States phenaproxima Massachusetts
  • 🇮🇳India libbna New Delhi, India

    Hey @phenaproxima I'm not sure I fully understand the reason for removing this line. We added the route because there wasn’t an existing route that redirects to the Project Browser help page. I referenced similar implementations in other modules when adding it. Could you please clarify why this line needs to be removed? $output .= '<dd>' . t('Users who have the <em>Administer modules</em> can browse modules from the <em>Browse projects</em> page.') . '</dd>'; Thanks.

  • 🇺🇸United States phenaproxima Massachusetts

    It's not that we want to remove the line, we want to remove the link. We should remove the link because the link cannot be generated unless you have the ID of an enabled source plugin. You can compute that dynamically, but it's sort of pointless to do in the context of the Help page.

  • 🇮🇳India libbna New Delhi, India
  • 🇺🇸United States phenaproxima Massachusetts

    Looks like the controller class is still there, but I'm not sure it's needed anymore...?

  • 🇮🇳India libbna New Delhi, India
  • 🇮🇳India libbna New Delhi, India
  • 🇮🇳India roshanibhangale

    Hi
    I have tested issue on Drupal 11.x

    Testing steps:

    1. Install Project Browser as normal.
    2. Go to /admin/modules of your site.
    3. Search for Project Browser
    4. Click on Help link, , issue reprodused

    After applied MR, the Help link is redirecting to the help page correctly.

    Attaching screenshot

    Moving to RTBC+1

Production build 0.71.5 2024