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."
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

anthonyroundtree created an issue. See original summary.

bhumikavarshney made their first commit to this issue’s fork.

bhumikavarshney’s picture

Status: Active » Needs review
kanchan bhogade’s picture

Status: Needs review » Needs work
StatusFileSize
new161.94 KB

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

chrisfromredfin’s picture

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.

libbna made their first commit to this issue’s fork.

libbna’s picture

StatusFileSize
new84.8 KB

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.

libbna’s picture

Status: Needs work » Needs review
kanchan bhogade’s picture

StatusFileSize
new117.72 KB

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

Help link working on Modules page.

phenaproxima’s picture

Status: Needs review » Needs work
libbna’s picture

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.

phenaproxima’s picture

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.

libbna’s picture

Status: Needs work » Needs review
phenaproxima’s picture

Status: Needs review » Needs work

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

libbna’s picture

Assigned: Unassigned » libbna
libbna’s picture

Assigned: libbna » Unassigned
Status: Needs work » Needs review
roshanibhangale’s picture

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

roshanibhangale’s picture

StatusFileSize
new59.8 KB

Hi

Attaching screenshot, as in previuos comment screenshot was not uploaded.

Moving to RTBC+1

roshanibhangale’s picture

Status: Needs review » Reviewed & tested by the community

chrisfromredfin’s picture

Status: Reviewed & tested by the community » Fixed

fixed and ported to both branches. the test fail is pre-existing in 2.0.x and not related to these changes.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.