Problem/Motivation

For my own workflow (jumping between the UI and the Drush command drush upgrade_status:analyze machine_name) I found it useful to have the machine_name of the module available in the UI.

Proposed resolution

On the form admin/reports/upgrade-status I propose we add a column with the module machine_name.

Screenshot:
https://www.drupal.org/files/issues/2021-07-09/2021-07-09-142424-upgrade...

See the attached patch.

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:

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

michaellenahan created an issue. See original summary.

michaellenahan’s picture

FileSize
1.49 KB

Here is the patch.

michaellenahan’s picture

Issue summary: View changes
michaellenahan’s picture

Title: Add a column for each module's machine_name » Add a column for each module's machine name

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

hotwebmatter’s picture

Status: Needs review » Reviewed & tested by the community

Great idea. Patch is simple Form API code, clearly appropriate, and works well. Make it so.

P.S.: Here's the screenshot:
Screenshot of UpgradeStatusForm with beautiful new column for machine name.

hotwebmatter’s picture

Issue summary: View changes
Kristen Pol’s picture

This would be helpful for me but I'd also *really* like a link to the project page. If you click on the project name, it gives you the upgrade status details. I'm wondering if this new column should be combined with a link off to the project page to handle this case as well. Thoughts?

Gábor Hojtsy’s picture

There is an abudance of columns and you already need a sizable screen to fit it all :D So I am a bit wary to add more. If we can come up with creative ways to present this differently or some existing data differently so that it fits better that would be great.

Kristen Pol’s picture

True :) What about tacking it onto the end of the first column, e.g. MEDIA ENTITY DOCUMENT (media_entity_document)?

michaellenahan’s picture

Issue summary: View changes
hmendes’s picture

Status: Reviewed & tested by the community » Needs review
FileSize
161.53 KB
989 bytes

Hello, adding a patch with the suggestion from #11 and a screenshot.

hmendes’s picture

I haven't updated the title and IS to wait to see if this approach is accepted first.
If you want i can change the MR as well.

Kristen Pol’s picture

Thanks for updating the patch. A couple things:

  1. +++ b/src/Form/UpgradeStatusForm.php
    @@ -340,6 +340,8 @@ class UpgradeStatusForm extends FormBase {
    +      $extension_pathname = $extension->getPathname();
    +      $extension_machine_name = explode('.', basename($extension_pathname))[0];
    

    Nitpick: How about combining these into one line? e.g.

    $extension_machine_name = explode('.', basename($extension->getPathname()))[0];
    
  2. +++ b/src/Form/UpgradeStatusForm.php
    @@ -348,7 +350,7 @@ class UpgradeStatusForm extends FormBase {
    -            '#value' => $extension->info['name'],
    +            '#value' => $extension->info['name'] . " (" . $extension_machine_name . ")",
    

    Nitpick: To be consistent with other code, it would be good to change the double quotes to single quotes like shown here:

    '#markup' => ' (' . $last_checked . ')',
    
Kristen Pol’s picture

I think it looks good :)

Kristen Pol’s picture

Actually, I see there is a $extension->getName() that could be used instead of getting the name yourself, so how about just using:

'#value' => $extension->info['name'] . ' (' . $extension->getName() . ')',

or, alternatively, adding the $extension->getName() when $extension->info['name'] gets set instead.

Kristen Pol’s picture

Status: Needs review » Needs work
hmendes’s picture

Status: Needs work » Needs review
FileSize
1 KB
616 bytes

Changing the patch to get the $extension->getName() instead of $extension->getPathname() as suggested in #17.

Looks cleaner now :)

Gábor Hojtsy’s picture

Title: Add a column for each module's machine name » Add machine name to each module's name for easier identification

Thanks! Re linking to the project page @kristen_pol, the drupal.org issues column already links to a filtered issue queue for the project. The project page itself should be one click from there. I know that is not a direct link but there is only so much space in this table :D

Gábor Hojtsy’s picture

Status: Needs review » Fixed

  • 1059064 committed on 8.x-3.x
    Issue #3222984 by hmendes, hotwebmatter, michaellenahan, Kristen Pol,...
Gábor Hojtsy’s picture

Status: Needs review » Fixed

Fix race condition problem :D

Status: Fixed » Closed (fixed)

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