Problem/Motivation

Currently the filter box in module list page(admin/modules) supports module name, not the machine name. For example, locale.module's name is 'Interface Translation' and no way to know this name without checking .info.yml

Proposed resolution

Allow to search by module machine name.

Remaining tasks

  1. Discuss
  2. Issue patch
  3. Test
Contributor tasks needed
Task Novice task? Contributor instructions Complete?
Reroll the patch if it no longer applies. Instructions
Update the issue summary noting if allowed during the beta Instructions

User interface changes

N/A

API changes

N/A

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

vijaycs85’s picture

Status: Active » Needs review
FileSize
1.01 KB

Initial patch...

swentel’s picture

+++ b/core/modules/system/system.admin.inc
@@ -576,8 +576,9 @@ function theme_system_modules_details($variables) {
+    $machine_name = array_pop($module['#parents']);

You can just use $key instead of having todo the array_pop.

vijaycs85’s picture

Thanks for the review @swentel. here is the update...

swentel’s picture

Status: Needs review » Reviewed & tested by the community

I love it.

vijaycs85’s picture

Issue summary: View changes
vijaycs85’s picture

Issue summary: View changes
catch’s picture

Issue tags: +Usability

Sorry this could do with a screenshot for reviewers, also tagging usability.

LewisNyman’s picture

Status: Reviewed & tested by the community » Needs review

Why can't the filter just parse the machine name as well as the module name? This feels like the kind of functionality that should 'just work'.

swentel’s picture

Status: Needs review » Reviewed & tested by the community
FileSize
25.51 KB

@Lewis - I don't get your question. The filter works by searching for 'table-filter-text-source' class and the patch adds it to the machine name column.

Added screenshot with the 'locale' example which you can't find currently, but with the patch you can. Still good to go imo.

LewisNyman’s picture

Ah I see, the way it was described in the summary made it sound like it was a UI option.

You know the visually hidden class means the machine is read to screen readers? Is that the intent?

vijaycs85’s picture

Status: Reviewed & tested by the community » Needs review
FileSize
757 bytes
41.51 KB
955 bytes

Thanks for the update @LewisNyman, No, I didn't know the existence of '.hidden'. Updating the patch. Checked locally and confirmed that the result is still the same on browser.

swentel’s picture

Status: Needs review » Reviewed & tested by the community

Ooh, good to know that too, RTBC now for real :)

xjm’s picture

webchick’s picture

Status: Reviewed & tested by the community » Needs review

Nice, so there is no UI impact, but if you happen to know the machine name you can search by it. This sounds really useful.

However, I'm not sure about the implementation, since it essentially shoves a hidden label of information in to the checkbox field like that, because it conflicts with the heading on that column (hidden from the UI but visible to screenreaders): (source core/modules/system/lib/Drupal/system/Form/ModulesListForm.php:)

        '#header' => array(
          array('data' => '<span class="visually-hidden">' . $this->t('Installed') . '</span>', 'class' => array('checkbox')),
          array('data' => $this->t('Name'), 'class' => array('name')),
          array('data' => $this->t('Description'), 'class' => array('description', RESPONSIVE_PRIORITY_LOW)),
        ),

So what about just making it an actual column, but hiding it from the table like you've already done here? Then a module like e.g. devel could always toggle the CSS hidden class off and expose this info.

swentel’s picture

Hmm, that would mean we'd get a 'Show row weights' automatically if we use the technique of hiding a table column. That would clutter the interface IMO, so I think this is really the best technique to use.

This patch used the same technique as on the simpletest overview page, so I think we're good no ?

YesCT’s picture

I was going to open a separate issue to make both the testing search and the module search have an actual column that devel could choose to show, but I couldn't find the similar code for the testing search.

I looked for something
hidden
and
table-filter-text-source
in
core/modules/simpletest/simpletest.theme.inc

LewisNyman’s picture

What are the actionable points here? It seems like we were very close. Are we going to add the column here or create a follow up.

YesCT’s picture

Issue summary: View changes
Issue tags: +Needs reroll, +Needs issue summary update

needs a beta evaluation. adding instructions to the summary. Maybe this is a usability task and not a feature request?

YesCT’s picture

Issue summary: View changes
lokapujya’s picture

Status: Needs review » Closed (duplicate)