Add links to Drupal.org project pages to module listings in /admin/modules

Created on 4 September 2017, almost 7 years ago
Updated 6 September 2023, 9 months ago

Problem/Motivation

Whilst established Drupal developers know that each contrib module has its own module page on Drupal.org, I'm now not convinced people new to Drupal are. Without this "insider knowledge", it is difficult to know where to go to see a list of issues for a module or read documentation and this leads to people finding that via Google and our documentation becomes rather disjointed.

Proposed resolution

Add links into the module listing that point to the module's project home page (found via the project key in the .info.yml file).

Something like:

Remaining tasks

  1. Usability review.
  2. Other reviews / refinements.
  3. RTBC.
  4. Commit.

User interface changes

A new link and icon on the /admin/modules page for modules hosted on Drupal.org.

Before

After

API changes

none

Data model changes

none

โœจ Feature request
Status

Needs review

Version

11.0 ๐Ÿ”ฅ

Component
Extensionย  โ†’

Last updated 3 days ago

No maintainer
Created by

๐Ÿ‡ฌ๐Ÿ‡งUnited Kingdom rachel_norfolk UK

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

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

  • Status changed to Needs work over 1 year ago
  • ๐Ÿ‡ฎ๐Ÿ‡ณIndia anweshasinha

    Hi,
    I have applied the patch from #94(project_link_9.5.x_dev_94.patch) in drupal 11.x version as the core version has changed to 11.x. So I made the necessary changes regarding the project link and attached the interdiff and the patch file. Please review it.

  • ๐Ÿ‡ฌ๐Ÿ‡งUnited Kingdom joachim

    Thanks for the patch.
    Remember to set an issue to 'needs review' when you post a new patch :)

    1. +++ b/core/modules/system/src/Form/ModulesListForm.php
      @@ -314,6 +314,28 @@ protected function buildRow(array $modules, Extension $module, $distribution) {
      +      $proj_url = Url::fromUri('https://www.drupal.org/project/' . $module->info['project']);
      

      Variable names shouldn't use abbreviations.

    2. +++ b/core/modules/system/src/Form/ModulesListForm.php
      @@ -314,6 +314,28 @@ protected function buildRow(array $modules, Extension $module, $distribution) {
      +    } else {
      

      'else' should not be coddled - should be on a new line.

    3. +++ b/core/modules/system/src/Form/ModulesListForm.php
      @@ -314,6 +314,28 @@ protected function buildRow(array $modules, Extension $module, $distribution) {
      +      // for those module whose info['project'] value is NULL
      

      Comments should be in sentence case with a full stop.

    4. +++ b/core/modules/system/src/Form/ModulesListForm.php
      @@ -314,6 +314,28 @@ protected function buildRow(array $modules, Extension $module, $distribution) {
      +      $module_name = "drupal";
      

      Drupal, if written in a human-readable text, should be 'Drupal' with a capital.

    5. +++ b/core/modules/system/src/Form/ModulesListForm.php
      @@ -314,6 +314,28 @@ protected function buildRow(array $modules, Extension $module, $distribution) {
      +      $proj_url = Url::fromUri('https://www.drupal.org/project/' . $module_Drupal);
      

      I don't see where this variable has been defined. Also, wrong case.

    6. +++ b/core/modules/system/tests/modules/system_test/system_test.module
      @@ -79,6 +79,12 @@ function system_test_system_info_alter(&$info, Extension $file, $type) {
      +  // prevent putting it directly into the .info.yml file.
      

      Comment needs to be a full sentence.

    7. +++ b/core/modules/system/tests/modules/system_test/system_test.module
      @@ -79,6 +79,12 @@ function system_test_system_info_alter(&$info, Extension $file, $type) {
      +    $info['project'] = 'system_test';
      

      I don't understand what this code is for.
      If we need this test module to have a 'project' key to test it, why not just put it in the info file?

  • ๐Ÿ‡ฎ๐Ÿ‡ณIndia anweshasinha

    Hi,
    I have made some more changes in the code based on #103 and have regenerated the patch again. Please do review it once and let me know.

  • Status changed to Needs review 10 months ago
  • ๐Ÿ‡บ๐Ÿ‡ธUnited States mlncn Minneapolis, MN, USA

    Looks good to me and works great!

    I don't have joachim's eye but i think everything mentioned in 103 has been addressed.

    A few notes, most important first:

    1. Projects that do not have an explicit project defined should absolutely not have a project page link. I don't see it discussed anywhere but linking to https://www.drupal.org/docs/extending-drupal/installing-modules โ†’ for dozens of core, custom, and laggard contrib modules adds visual clutter and will make people less likely to use and get any value out of the useful links. I do not see this discussed anywhere in this issue and consider the introduction a hard no from this reviewer. There simply should not be any Project link if none is available, same as there's no Help, Configure, or Permissions link if any of those are inapplicable.
    2. If there is no immediate short-term plan for d.o core modules to take over their namespaces at drupal.org/project/ then i think it is imperative to allow links to other locations, at least on drupal.org. (A project_page option for *.info.yml files that can override building the link based on project, say.) Honestly i think we should allow links to non-Drupal project pages or standalone project websites. (I am make public and contribute on d.o any potentially useful module myself, but we know this feature would be useful for university or large organization deployments with many in-house modules, and other not-on-d.o projects.) All that would be a follow-up issue and maybe should be a separate "More information" link or something. Actually even if we never ditch *.info.yml for composer.json, if we allow more links, we should use the same keys, as jrocowitz outlined โœจ Add links to Drupal.org project pages to module listings in /admin/modules Needs review , for the non-project page linksโ€” or d.o can start parsing the composer.json and including these links on the d.o project page! All that said as long is 1) is done i think we should get this patch in and then figure out the right solution for core and custom projects.
    3. It's pretty notable the lack of icon for Project compared to the other links. I think this is supplied by Claro so not part of this patch, but noting this was discussed before in this issue thread and the usability group recommended an icon which indicates this is an external link (as well as adding the text " (external link)" to the end of the visually hidden span). Rather than making the icon before the word Project the "arrow out of box" icon that is usually used after a link to indicate it is external, i would advocate for the old-school globe website icon, ๐ŸŒ available in UNICODE and as an SVG here. Also not reason to hold up this patch.
  • ๐Ÿ‡บ๐Ÿ‡ธUnited States mlncn Minneapolis, MN, USA
  • ๐Ÿ‡บ๐Ÿ‡ธUnited States mlncn Minneapolis, MN, USA
  • last update 10 months ago
    Custom Commands Failed
  • Status changed to Needs work 10 months ago
  • The Needs Review Queue Bot โ†’ tested this issue. It fails the Drupal core commit checks. Therefore, this issue status is now "Needs work".

    This does not mean that the patch needs to be re-rolled or the MR rebased. Read the Issue Summary, the issue tags and the latest discussion here to determine what needs to be done.

    Consult the Drupal Contributor Guide โ†’ to find step-by-step guides for working with issues.

  • ๐Ÿ‡ฎ๐Ÿ‡ณIndia anweshasinha

    Hi,
    I have made some more changes in the code based on #108 and have regenerated the patch again. Please do review it once and let me know.

  • ๐Ÿ‡ฌ๐Ÿ‡งUnited Kingdom joachim
    1. +++ b/core/modules/system/src/Form/ModulesListForm.php
      @@ -92,14 +92,14 @@ class ModulesListForm extends FormBase {
      +          $container->get('module_handler'),
      +          $container->get('module_installer'),
      +          $container->get('keyvalue.expirable')->get('module_list'),
      +          $container->get('access_manager'),
      +          $container->get('current_user'),
      +          $container->get('user.permissions'),
      +          $container->get('extension.list.module')
      +      );
         }
      

      This indentation shouldn't be changing.

    2. +++ b/core/modules/system/src/Form/ModulesListForm.php
      @@ -141,7 +141,7 @@ public function getFormId() {
      -    require_once DRUPAL_ROOT . '/core/includes/install.inc';
      +    include_once DRUPAL_ROOT . '/core/includes/install.inc';
      

      Unrelated change?

    3. +++ b/core/modules/system/src/Form/ModulesListForm.php
      @@ -175,9 +175,11 @@ public function buildForm(array $form, FormStateInterface $form_state) {
      +      $modules = array_filter(
      +            $modules, function ($module) {
      +                return !$module->isObsolete();
      +            }
      +        );
      

      Indentation being changed.

    I'm going to stop there -- it looks like your IDE has let loose and changed lots of formatting.

  • ๐Ÿ‡ฎ๐Ÿ‡ณIndia anweshasinha

    Hi,
    I have made the changes in my patch according to #111 and have regenerated the patch again. Please do review it once and let me know.

  • Status changed to Needs review 9 months ago
  • last update 9 months ago
    Custom Commands Failed
  • last update 9 months ago
    Custom Commands Failed
  • last update 9 months ago
    30,076 pass, 1 fail
  • ๐Ÿ‡ท๐Ÿ‡บRussia kostyashupenko Omsk
Production build 0.69.0 2024