Problem/Motivation

When you visit /admin/modules/uninstall and search for a module machine_name, you will not find a result. The problem gets really visible, when you use modules where the module's machine_name differs from the human-readable name.

Examples in Core and Contrib:

  • Database Logging (dblog)
  • Chaos tools (ctools)

Especially in contrib we see more such examples, where also the module project page presents another name, as the human-readable name (see Chaos tool suite, Configuration Update Manager).

Those inconsistencies let developers (when not using drush) to filter the module list by the module's machine_name. That is working fine at the module list, because the machine_name is part of the description, but not on the uninstall page).

Steps to reproduce the problem

Different behavior between the module list and uninstall module page.

Module list

  1. Go to /admin/modules
  2. Filter for dblog
  3. You'll see the "Database Logging" module

Uninstall module

  1. Go to /admin/modules/uninstall
  2. Filter for "dblog"
  3. You'll see no results

Proposed resolution

Make the filter by module machine_name working in the table at /admin/modules/uninstall.

Tasks

  • Decide, if it is a bug/feature request and/or should be fixed
  • DONE. Going to add machine name into a new details element. Decide, if we should
    • NO. Show the module machine_name in the description column, or in it's own column.. Rejected because it takes up too much page space.
    • NO. or include it visibility-hidden (if it would be allowed UX-wise) to only make it searchable. Presenting content to screen reader users but not to sighted users isn't inclusive design, rejected on accessibility grounds.
    • YES. Convert the description into a openable details element and add the machine name into it.
  • Update the system-modules-uninstall.html.twig template.
    • DONE. Add module machine name to template variables via preprocess hook.
    • DONE. Document the machine name variable in template docblock.
    • DONE. Convert description to a details element.
    • DONE. Add details machine name column to the new details element.
    • DONE. Add the show-all-columns feature. {{ attach_library('core/drupal.tableresponsive') }} in the form.
    • DONE. Make the description column responsive, by adding priority-low to match the install page.
    • DONE. Copy the template to Claro and adjust css classes to align with Claro install template.
    • DONE. Expand the javascript test to use the Claro theme in addition to the default, to test filtering on the new template.

User interface changes

Introduces a new machine name table column on the modules uninstall page. The machine name becomes searchable in the filter.
Make the uninstall table responsive, because the install page is already responsive.

Before

before

After - original solution

after - original

After - final solution

after - new

API changes

None

Data model changes

None

CommentFileSizeAuthor
#92 uninstall on claro with expanable details.png242.93 KBjonathan1055
#82 uninstall filter olivero.png245.84 KBjonathan1055
#82 uninstall filter claro.png236.57 KBjonathan1055
#77 CleanShot 2023-01-25 at 08.59.01@2x.png138.71 KBalexpott
#77 CleanShot 2023-01-25 at 08.58.39@2x.png233.52 KBalexpott
#67 Screen Shot 2023-01-16 at 11.07.15 AM.png196.43 KBsmustgrave
#67 Screen Shot 2023-01-16 at 11.07.30 AM.png194.6 KBsmustgrave
#64 Screenshot from 2023-01-13 10-24-48.png28.54 KBRishabh Vishwakarma
#64 2895388-64.patch5.88 KBRishabh Vishwakarma
#56 2895388--after--patch--pic.png27.72 KBvikashsoni
#56 2895388--before--patch--pic.png37.43 KBvikashsoni
#51 interdiff_40-51.txt3.56 KBraman.b
#51 2895388-51.patch6.03 KBraman.b
#51 2895388-51-FAIL.patch2.19 KBraman.b
#46 drupal-uninstall_machine_name-2895388-reviewed-solved.gif268.12 KBAbhijith S
#44 Screen Shot 2020-07-28 at 2.02.55 PM.png282.49 KBtanubansal
#44 Screen Shot 2020-07-28 at 2.01.17 PM.png275.06 KBtanubansal
#40 interdiff-2895388-33-40.diff.txt696 bytesszeidler
#40 drupal-uninstall_machine_name_filter-2895388-40.patch2.93 KBszeidler
#34 install-2895388-34.png19.74 KBHaza
#33 2895388-27-33.diff.txt6.5 KBszeidler
#33 drupal-uninstall_machine_name_filter-2895388-33.patch2.93 KBszeidler
#29 Uninstall_small_screen.png21.9 KBifrik
#27 drupal-uninstall_machine_name_filter-2895388-27.patch8.55 KBszeidler
#24 drupal-uninstall_machine_name_filter-2895388-24.patch8.59 KBszeidler
#22 interdiff-2895388-15-22.diff.txt4.6 KBszeidler
#22 drupal-uninstall_machine_name_filter-2895388-22.patch8.61 KBszeidler
#2 modules_uninstall_filter_machine_name-2895388-2-8.4.x-dev.patch1.96 KBkarthikeyan-manivasagam
#4 module-filter-before-after.gif1.04 MBszeidler
#7 extend-filter.png9.04 KBifrik
#7 uninstall-filter-after.png17.12 KBifrik
#7 uninstall-filter-before.png13.86 KBifrik
#11 uninstall-filter-own-column.png131.82 KBszeidler
#11 drupal-uninstall_machine_name_filter-2895388-11.patch2.5 KBszeidler
#11 interdiff-2895388-2-11.diff.txt2.26 KBszeidler
#15 drupal-uninstall_machine_name_filter-2895388-15.patch7.65 KBszeidler
#15 interdiff-2895388-11-15.diff.txt8 KBszeidler
#16 modules-uninstall-seven.png151.81 KBtstoeckler
#15 uninstall-filter-with-responsive-medium.png135.06 KBszeidler
#16 modules-uninstall-bartik.png149.96 KBtstoeckler
#16 modules-uninstall-stark.png144.31 KBtstoeckler

Issue fork drupal-2895388

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

szeidler created an issue. See original summary.

karthikeyan-manivasagam’s picture

cilefen’s picture

Title: Modules Uninstall filter should find also module machine_name's » Modules uninstall filter does not filter by machine name
szeidler’s picture

Thanks for providing the patch @karthikeyan-manivasagam and fixing the issue title @cilefen.

I can confirm, that the patch is fixing the issue using my suggested .visibility-hidden approach.
In the attached screencast you will be able to see the before and after behavior.

Version: 8.4.x-dev » 8.5.x-dev

Drupal 8.4.0-alpha1 will be released the week of July 31, 2017, which means new developments and disruptive changes should now be targeted against the 8.5.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

szeidler’s picture

Issue tags: +Needs usability review
ifrik’s picture

Status: Needs review » Reviewed & tested by the community
FileSize
9.04 KB
17.12 KB
13.86 KB

Thanks this is a good catch that removes some inconsistency in the user experience. With the patch both filter fields on the Modules and the Uninstall page return the same results.

Filter on the Extend page:

Filter on the Uninstall page before:

Filter on the Uninstall with patch:

tstoeckler’s picture

Status: Reviewed & tested by the community » Needs review
Issue tags: +Needs accessibility review

This is a really nice feature, thanks everyone for working on it! Kudos for adding the dir attribute for non-LTR languages, very nice.

Re #7: Did you mean to remove the "Needs usability review" tag? Not sure, so keeping it for now.

+++ b/core/modules/system/templates/system-modules-uninstall.html.twig
@@ -43,6 +43,7 @@
           <span class="text module-description">{{ module.description }}</span>
+          <span dir="ltr" class="table-filter-text-source visually-hidden">{{ module.machine_name }}</span>

I am anything but an accessibility expert, but simply looking at the markup: Won't this simply read the module machine name right after the description for screen-reader users? I.e. "Logs and records system events to the database.dblog". That seems a bit strange, instead I think we should add a (hidden) label for this field. I.e. the markup could be something like this:

          <span class="text module-description">{{ module.description }}</span>
          <div class="visually-hidden">{{ 'Machine name: '|t }}<span dir="ltr" class="table-filter-text-source">{{ module.machine_name }}</span></div>

As far as I can tell, this would make the output more sensible for screen readers. Although, having written that, we generally try to avoid translating such "chopped-up" strings. I.e. ideally, we would translate Machine name: @machine-name in its entirety. That is not really so easy, though, because of the added wrapping markup, but also because the dir="ltr" makes this somewhat of a special-case.

Phew, not really sure. In any case I guess the "needs accessibility review" tag can't hurt here.

ifrik’s picture

Issue tags: -Needs usability review

You were right: no additional UX review needed.

andrewmacpherson’s picture

Issue summary: View changes
Status: Needs review » Needs work
Issue tags: -Needs accessibility review +Accessibility

Accessibility review of the patch from #2.

I enabled the 4 multilingual modules in core, then filtered by "loc", which matches machine name "locale" of the Interface translation module.

There are some accessibility problems with this.

  • The machine name is included as visually-hidden text. Sighted users will not encounter it, which is potentially confusing. (WTF? How does "loc" match "Interface Translation"?). Sighted users should get the machine name too - there's no reason why a screen reader user needs it but a sighted user doesn't. The machine names are visible on the install page, albeit buried inside a collapsed <details>.
  • The machine name is presented in without context. A screen reader user hears the description as "Translates the built-in user interface. locale.". Compare this with the install page, where the visible text says "Machine name: locale".

From the issue summary:

  • Decide, if we should
    • show the module machine_name in the description column
    • or include it visibility-hidden (if it would be allowed UX-wise) to only make it searchable

Showing the machine name is preferable. I'd say an extra column just for the machine name is the simplest way to do it, rather than putting it in the description column. Updating issue summary with this.

szeidler’s picture

I'd say an extra column just for the machine name is the simplest way to do it, rather than putting it in the description column.

Thanks all for the thoroughly feedback. I'm taking up the suggestion in #11 and providing the machine name in an own column name.

Uninstall filter using machine name in an own column

ifrik’s picture

How about adding "priority-medium" as class to the th and td of the machine name column so that it doesn't get in the way on small screens?

andrewmacpherson’s picture

Patch in #11 - Nice! This is a much more inclusive design.

The patch modifies templates inside the Stable theme. This isn't normally allowed during the D8 minor releases, so I expect we'll have to copy the template from system module to the Seven (and Bartik?) themes, and leave the Stable theme untouched.

Re: 12 - Good idea! Medium priority sounds right. Here's the change request which describes how to add those responsive table classes:
Responsive table classes for modules and themes

andrewmacpherson’s picture

Status: Needs review » Needs work

Hmm, I'm not sure if that change reocrd is relevant anymore. The table headers are in the twig file.

TODO:
add the responsive priority-medium class to the machine name column.
don't change Stable theme
copy system module template to Seven + Bartik themes instead

szeidler’s picture

Hmm, I'm not sure if that change reocrd is relevant anymore. The table headers are in the twig file.

It seems, that it only applys for render arrays. At least in /core/modules/system/templates/system-modules-details.html.twig, I saw an example, that directly uses the priority class definition in a twig file.

✔ add the responsive priority-medium class to the machine name column.
✔ don't change Stable theme
✔ copy system module template to Seven + Bartik themes instead

Uninstall filter with applied priority-medium class on machine name column

tstoeckler’s picture

Tried out the new patch and it works great in all three themes.

I found a number of bugs related to responsive tables and table-striping but none of them are caused by this patch, so will open dedicated issues for those in a minute.

Also attaching screenshots in all three themes.

Not RTBC-ing as this touches a number of areas that I'm not to knowledgable about and I feel like I would going out on three limbs (i.e. accessibility, usability, theme system) at once by pulling the trigger on this one. But I couldn't find anything to complain about.

ifrik’s picture

From a usability point of view: it can be RTBC.

tstoeckler’s picture

andrewmacpherson’s picture

Issue summary: View changes
Status: Needs review » Needs work

Re: #16 - good catch on the show-all-columns link.

The install page already has responsive columns. It treats the description column as low priority, so on a phone you just see the checkbox and human-readable module name. To match this, let's make the description column low priority here. I think we can leave the machine name column as medium priority for tablets, as the overall intent of this patch is to help site builders who are familiar with machine names.

The module name variable should be documented in the template's docblock.

Updating issue summary, detailing tasks done/todo, and noting UI changes.

andrewmacpherson’s picture

Issue summary: View changes

fixing broken list nested markup in summary.

andrewmacpherson’s picture

There are quite a lot of related issues, in particular a bug with the screen reader announcement on the filter. Reviewing these, I think it's safe to keep them as separate issues, and just focus adding the machine name column to the table here. This issue is moving quickly, and the others would still need fixing regardless of the machine name column.

szeidler’s picture

✔ Document the machine name variable in template docblock.
✔ Add the show-all-columns feature. {{ attach_library('core/drupal.tableresponsive') }} in template.

Decide: should we make the description column responsive? priority-low would match the install page.

I took the proposal up and integrated it into the attached patch. I think consistency with the install page is desirable.

tstoeckler’s picture

Status: Needs review » Needs work
Issue tags: +Needs reroll
szeidler’s picture

Status: Needs work » Needs review
FileSize
8.59 KB

Here's the reroll, so that the patch applies cleanly after #2923305: Module (un-)install tables have a useless "data-striping" attribute

tstoeckler’s picture

Issue tags: -Needs reroll

Wow, that was quick. Thanks!

andrewmacpherson’s picture

Status: Needs review » Needs work

Thanks @szeidler. Review of patch #24:

It removes the data-striping attribute from the template in the system module, and the patch applies cleanly.
But there's atill a data-striping attribute in the Seven and Bartik versions, which are new files.

TODO: remove the data-striping attribute from the Seven and Bartik templates.

szeidler’s picture

Status: Needs work » Needs review
FileSize
8.55 KB

Oh :(, you're absolutely right.

Adding a new patch, that includes the removal of the data-stripping on the newly created templates.

Version: 8.5.x-dev » 8.6.x-dev

Drupal 8.5.0-alpha1 will be released the week of January 17, 2018, which means new developments and disruptive changes should now be targeted against the 8.6.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

ifrik’s picture

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

Modules can be found machine name, the table is responsive and the points raised in #26 are addressed.

alexpott’s picture

Status: Reviewed & tested by the community » Needs work
+++ b/core/modules/system/templates/system-modules-uninstall.html.twig
--- /dev/null
+++ b/core/themes/bartik/templates/system-modules-uninstall.html.twig

+++ b/core/themes/bartik/templates/system-modules-uninstall.html.twig
--- /dev/null
+++ b/core/themes/seven/templates/system-modules-uninstall.html.twig

We can just do

{% extends "@system/system-modules-uninstall.html.twig" %}

Instead of duplicating the entire thing.

Also rather then having the machine name comment. Did we considers just using the same format as the install page - i.e putting the machine name in a collapsible thingy along with the other info.

szeidler’s picture

Thanks for your response, @alexpott.

@andrewmacpherson recommended to add as a column in #10.

Showing the machine name is preferable. I'd say an extra column just for the machine name is the simplest way to do it, rather than putting it in the description column. Updating issue summary with this.

Version: 8.6.x-dev » 8.7.x-dev

Drupal 8.6.0-alpha1 will be released the week of July 16, 2018, which means new developments and disruptive changes should now be targeted against the 8.7.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

szeidler’s picture

I updated the patch avoiding the code duplication and using {% extends %} instead as suggested in #30.

Haza’s picture

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

Re-tested latest patch (without code duplication). Still works fine.

alexpott’s picture

Status: Reviewed & tested by the community » Needs work
+++ b/core/modules/system/templates/system-modules-uninstall.html.twig
@@ -28,7 +30,8 @@
+      <th class="priority-medium">{{ 'Machine name'|t }}</th>
+      <th class="priority-low">{{ 'Description'|t }}</th>

It feels like the description is a higher priority than the machine name which in many cases is going to be a duplicate of the Name column. Which is one of my concerns about this patch... Views views is not entirely useful. Whilst a column might be the simplest way I still don't understand why we're not following the example of the listing page where you install and including it in the description.

alexpott’s picture

Issue tags: +Needs tests

We also should have a test asserting that a machine name does appear on the uninstall page.

andrewmacpherson’s picture

It feels like the description is a higher priority than the machine name which in many cases is going to be a duplicate of the Name column

Fair point, they will often be similar. I don't think it's a big problem to swap those priorities.

I still don't understand why we're not following the example of the listing page where you install and including it in the description.

That should be a separate issue I think. Whatever the historical reasons, these pages ended up with a different UI. Adding an extra column here is just a simple way to solve the problem without needing to rethink the design.

FWIW, I don't think the install page is any better. Concealing the machine-name inside a details element means there are sometimes matches with no obvious reason. For example "lo" matches locale machine name, but isn't seen in the human-readable name or description.

andrewmacpherson’s picture

szeidler’s picture

As of #36, I swapped the priorities.

We also should have a test asserting that a machine name does appear on the uninstall page.

Out of curiosity: As we're not changing the "stable" theme, how would that work in the test?

It would be something like the following in Drupal\Tests\system\Functional\Module\UninstallTest

// Make sure the module machine name is rendered in a filter text source.
$this->assertSession()->elementTextContains('css', 'tr[data-drupal-selector="edit-module-test"] .module-machine-name.table-filter-text-source', 'module_test');

Version: 8.7.x-dev » 8.8.x-dev

Drupal 8.7.0-alpha1 will be released the week of March 11, 2019, which means new developments and disruptive changes should now be targeted against the 8.8.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.8.x-dev » 8.9.x-dev

Drupal 8.8.0-alpha1 will be released the week of October 14th, 2019, which means new developments and disruptive changes should now be targeted against the 8.9.x-dev branch. (Any changes to 8.9.x will also be committed to 9.0.x in preparation for Drupal 9’s release, but some changes like significant feature additions will be deferred to 9.1.x.). For more information see the Drupal 8 and 9 minor version schedule and the Allowed changes during the Drupal 8 and 9 release cycles.

Version: 8.9.x-dev » 9.1.x-dev

Drupal 8.9.0-beta1 was released on March 20, 2020. 8.9.x is the final, long-term support (LTS) minor release of Drupal 8, which means new developments and disruptive changes should now be targeted against the 9.1.x-dev branch. For more information see the Drupal 8 and 9 minor version schedule and the Allowed changes during the Drupal 8 and 9 release cycles.

tanubansal’s picture

Tested via below mentioned steps and latest patch #40:

Module list

Go to /admin/modules
Filter for dblog
You'll see the "Database Logging" module

Uninstall module

Go to /admin/modules/uninstall
Filter for "dblog"
You'll see no results

Now, uninstall filter does filter by machine name.
This can be moved to RTBC

Abhijith S’s picture

Assigned: Unassigned » Abhijith S
Abhijith S’s picture

I have tested using the patch #40.The issue is solved after applying the patch.
Including the screenshot gif : https://www.drupal.org/files/issues/2020-07-28/drupal-uninstall_machine_...

Abhinand Gokhala K’s picture

Status: Needs review » Reviewed & tested by the community

Issue_fixed

Hi Tanubansal and Abhijith, Thanks for your time. Abhijith, I have tested the same #40 patch and it is also working from my end. I also didn't find any coding issue in that patch.

Abhinand Gokhala K’s picture

Assigned: Abhijith S » Unassigned
larowlan’s picture

Status: Reviewed & tested by the community » Needs work

We still have the needs tests tag here.
As this is a bug report, we need some test coverage demonstrating the issue, and that the fix resolves the issue.

rajandro’s picture

I am working on the automated test to cover this scenario.

raman.b’s picture

Adding test coverage to demonstrate the bug and fix for the issue.

Do we need system-modules-uninstall.html.twig for claro?

The last submitted patch, 51: 2895388-51-FAIL.patch, failed testing. View results

Version: 9.1.x-dev » 9.2.x-dev

Drupal 9.1.0-alpha1 will be released the week of October 19, 2020, which means new developments and disruptive changes should now be targeted for the 9.2.x-dev branch. For more information see the Drupal 9 minor version schedule and the Allowed changes during the Drupal 9 release cycle.

Version: 9.2.x-dev » 9.3.x-dev

Drupal 9.2.0-alpha1 will be released the week of May 3, 2021, which means new developments and disruptive changes should now be targeted for the 9.3.x-dev branch. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

Version: 9.3.x-dev » 9.4.x-dev

Drupal 9.3.0-rc1 was released on November 26, 2021, which means new developments and disruptive changes should now be targeted for the 9.4.x-dev branch. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

vikashsoni’s picture

Applied #15 patch in drupal-9.3.x-dev applied successfully
After patch we able to filter module with machine name at a while of uninstall page
Thanks for the patch
For ref sharing screenshots .....

JeroenT’s picture

+++ b/core/themes/bartik/templates/system-modules-uninstall.html.twig
@@ -0,0 +1 @@
+{% extends "@system/system-modules-uninstall.html.twig" %}

+++ b/core/themes/seven/templates/system-modules-uninstall.html.twig
@@ -0,0 +1 @@
+{% extends "@system/system-modules-uninstall.html.twig" %}

Is there a reason we use extend here? Can't we just delete those templates and the templates defined in the system module will be used?

I also think we should update the templates in stable and stable9.

JeroenT’s picture

Status: Needs review » Needs work
bnjmnm’s picture

Removing credit for #56 as sufficient screenshots were already provided in #47, and the "after" (were it needed), should show an example of filtering to a list that includes matches, not an empty one.

Version: 9.4.x-dev » 9.5.x-dev

Drupal 9.4.0-alpha1 was released on May 6, 2022, which means new developments and disruptive changes should now be targeted for the 9.5.x-dev branch. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

Version: 9.5.x-dev » 10.1.x-dev

Drupal 9.5.0-beta2 and Drupal 10.0.0-beta2 were released on September 29, 2022, which means new developments and disruptive changes should now be targeted for the 10.1.x-dev branch. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

quietone’s picture

This was a bugsmash triage target today. I tested this on Drupal 10.1.x, umami install and reproduced the problem.

The patch needs to be brought up to date. There is a question to answer in #57.

szeidler’s picture

#57: Adding the extend was based on the feedback in #30, but might need to be reevaluated with the current best practices in Core.

Rishabh Vishwakarma’s picture

Status: Needs work » Needs review
FileSize
5.88 KB
28.54 KB

Created a patch for latest version of Drupal. Please review.

jonathan1055’s picture

Issue tags: -Needs reroll

No interdiff, but I have compared patch #64 against #51 and the differences are:

  1. Trailing whitespace added to core/modules/system/templates/system-modules-uninstall.html.twig (but there was no coding standards fault, so maybe .twig files are not checked for this?)
  2. Bartik and Seven twig templates are dropped
  3. Olivero twig template added instead
  4. No new line at end of Olivero template

I've not been involved with the actual work on this, so cannot comment on any previous actual chnages, just giving the comparison from last patch.

In response to raman.b in #51 yes we should cater for Claro, given that it is the new default admin theme. Just tested the UI manaully and it works fine already in Claro, but if we are adding a twig template for Olivero we should add one for Claro too.

smustgrave’s picture

Status: Needs review » Needs work
Issue tags: +Needs change record

If we are going to change the templates we will need a change record for contrib themes.

smustgrave’s picture

Issue summary: View changes
Status: Needs work » Reviewed & tested by the community
Issue tags: -Needs change record
FileSize
194.6 KB
196.43 KB

Added a change record.

Testing the patch can confirm it is filtering by machine name now

Uploading before/after screenshots to IS

mgifford’s picture

Issue tags: +wcag323

Think this falls under 3.2.3.

jonathan1055’s picture

Status: Reviewed & tested by the community » Needs work

Minor tweaks required for #65 .1 and .4 and Claro template

jonathan1055’s picture

Status: Needs work » Needs review

Using MR so that we can more easily see changes without providing interdiff. The first commit is patch #64.

From #57

Is there a reason we use extend here? Can't we just delete those templates and the templates defined in the system module will be used?

From #63

Adding the extend was based on the feedback in #30, but might need to be reevaluated with the current best practices in Core.

So I have removed the Olivero template which appears to be unnecessary. Also fixed trailing space.

smustgrave’s picture

Status: Needs review » Reviewed & tested by the community
Issue tags: +Needs Review Queue Initiative

This issue is being reviewed by the kind folks in Slack, #needs-review-queue-initiative. We are working to keep the size of Needs Review queue [2700+ issues] to around 400 (1 month or less), following Review a patch or merge request as a guide.

Testing MR 3273

On Drupal 10.1.x with a standard install
Verified seeing machine_name now.
Go to the uninstall page and searched for menu_link and got "Custom Menu Link" which was expected

jonathan1055’s picture

One minor inconsistency I noticed (in code, not in functionality) is the way that the drupal.tableresponsive library is added. The Install page form already had $form['#attached']['library'][] = 'core/drupal.tableresponsive'; but this was missing from the uninstall form. It does not appear to be needed for manual interactive functioning of the filter, but it is required to allow the javascript tests to react to changing input. It was only when the uninstall form got it's first javascript test (in this issue) that the library was added. However, it was added via {{ attach_library('core/drupal.tableresponsive') }} in templates/system-modules-uninstall.html.twig

So is there a preference for adding the library via the $form or via the twig template? Even if there is no preference, we should make the two consistent, so that we don't ask this question again. I inadvertantly also added the library to the uninstall $form in this MR (because I was working on #3331975: Uninstall form does not add drupal.tableresponsive library so we at least need to remove one of them as it is unnecessary to do it twice.

alexpott’s picture

Status: Reviewed & tested by the community » Needs work

We need to resolve #73 before committing this.

jonathan1055’s picture

Status: Needs work » Needs review

Thanks @alexpott. I have removed the attach from the twig template, and left it in the $form. This also matches what is in the install form.

smustgrave’s picture

Status: Needs review » Reviewed & tested by the community

Retested following steps from #72

Good job @jonathan1055!

alexpott’s picture

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

I've looked at the design of this and I'm not sure what was implemented in #11 is the best we can do. I think we should do what the install form does and add the machine name to the description so that it appears visually (unlike patches before which added it as hidden text).

The machine name is not at all important when uninstalling a module - it's really only useful as something you might know to search for. Yet we're placing in in front of the description which can contain important things like why a module can not be uninstalled.

Compare...
Module install with nice small machine name

With...
Module uninstall with in-your-face machine name

jonathan1055’s picture

I agree with @alexpott. Adding the new column just to get the machine name on the page is not the best way to do it. It wastes a lot of screen space, meaning more scrolling, and shows duplicated info for 90% of the modules. This is an admin page, and making admin tasks quick to achieve is a primary goal. It seems from comments #10 and #11 that the decision to make it a new column was done for ease of coding. It's a backwards step in usability and we should be able to improve it to be more like the install page.

In the first instance the machine name can be added into the description cell. In the longer term, we could have a details element, collapsed by default, to match the install page.

smustgrave’s picture

Status: Needs review » Needs work

Moving to NW for that change then. Makes sense to me.

jonathan1055’s picture

Assigned: Unassigned » jonathan1055
Status: Needs work » Needs review

Happy to give this a try, unless anyone else wants to do it? No need for more than one person to do duplicate work.

jonathan1055’s picture

Status: Needs review » Needs work

Argh, unintentional change (stale-form data?). Back to NW

jonathan1055’s picture

Assigned: jonathan1055 » Unassigned
Status: Needs work » Needs review
FileSize
236.57 KB
245.84 KB

First draft. Based the details element on the install page. Themeing was OK but not looking quite right, then I realised that Claro has it's own custom twig template for the install page, so I also made one for the uninstall page.

uninstall filter claro

uninstall filter olivero

I puposely left the modified twig template indentation wrong on the first commit, so that it is eaaier to see which lines are changed and which have not been altered but merely indented.

If/when this design change is accepted I will update the issue summary.

jonathan1055’s picture

The test failures were because I missed copying {{ form|without('filters', 'modules', 'uninstall') }} when creating the Claro template, which meant that the Uninstall button was not in the form. I based it on the install template, which does not have this. Interesting that it was only picked up by HelpTopicSearchTest which checks for uninstalling. Or maybe other tests use the system twig template? The HelpTopic test has protected $defaultTheme = 'stark' so I'm not sure why the Claro template was being used anyway. But lucky that it was, otherwise we would have have green passing tests for a major error in the code.

jonathan1055’s picture

Are these test failures random and/or unrelated to the chnages in this MR?

Failure 26 Jan 2023 at 01:46 GMT https://www.drupal.org/pift-ci-job/2576971

Drupal\Tests\ckeditor5\FunctionalJavascript\MediaLibraryTest::testButton
Failed asserting that a NULL is not empty.

Rebase against 10.1.x but no code changes on this MR, we get a different fail
26 Jan 2023 at 11:28 GMT https://www.drupal.org/pift-ci-job/2577847

Drupal\Tests\ckeditor5\FunctionalJavascript\CKEditor5AllowedTagsTest::testMediaElementAllowedTags
Behat\Mink\Exception\ElementNotFoundException: Form field with id|name|label|value "filters[media_embed][settings][allowed_view_modes][view_mode_2]" not found.

Branch test at 26 Jan 2023 at 12:42 GMT passes OK.

jonathan1055’s picture

I think the failures here are unrelated because there was a branch test at 25 Jan 2023 at 11:48 GMT with the same failure in ests/src/FunctionalJavascript/CKEditor5AllowedTagsTest
https://www.drupal.org/pift-ci-job/2576653

smustgrave’s picture

If they’re ckeditor5 functionalJavascript most likely random.

jonathan1055’s picture

Status: Needs review » Needs work

Yes, either random or unrelated to this MR, core branch did have a failure ealier. Re-ran after new rebase and all passes here now.

Are we in principle agreed that the expanding details element I added in #82 in response to @alexpott in #77 is the right solution? It works for me, but would be good to get confirmation as many others have looked at this issue before I started on it.

I am going to expand the test coverage for the uninstall page to check the Claro template in addition to the system default, as it was only by luck that the HelpTopic tests used the Claro theme and tested uninstalling, which showed the error in my change.

jonathan1055’s picture

Status: Needs work » Needs review

I have expanded the test to cover Claro theme in addition to the default. This will fail, demonstrating that the Claro template needs work. Also attempting to run only the 'system' module tests temporarily, for speed and efficiency.

jonathan1055’s picture

As expected, we now have one test failure:

There was 1 error:
1) Drupal\Tests\system\Functional\Module\UninstallTest::testUninstallPage with data set #1 ('claro')
Behat\Mink\Exception\ElementNotFoundException: Element matching css "tr[data-drupal-selector="edit-module-test"] .module-machine-name.table-filter-text-source" not found.

This shows that the new claro template system-modules-uninstall.html.twig is now being tested when it was not before.

jonathan1055’s picture

Tests now pass. Here are few other tweaks to the claro template, to make it align better with both the Claro install template, as I based the original template only on system uninstall. This is now ready for full review again.

smustgrave’s picture

Status: Needs review » Needs work
Issue tags: +Needs change record updates

Functional this works like a charm.

Searching for dynamic_page_cache I get nothing
Apply the fix and not I get the module.

Tagging for CR updates as there seems to be additional changes to the system template that others may need to adopt for their custom themes.

jonathan1055’s picture

Updated the issue summary to match the solution.

star-szr’s picture

I made some updates to the change record but I haven't fully updated it as suggested in #91.

jonathan1055’s picture

Thanks. The change record still refers to adding a new column, but that is not how the solution is. Since #77 the description is now a details element, collapsed by default, but expandable to show machine name and requirements, similar to what is done on the install page.

Sorry I can't update the change record right now, happy for someone else to do it, or I will next week.

Version: 10.1.x-dev » 11.x-dev

Drupal core is moving towards using a “main” branch. As an interim step, a new 11.x branch has been opened, as Drupal.org infrastructure cannot currently fully support a branch named main. New developments and disruptive changes should now be targeted for the 11.x branch, which currently accepts only minor-version allowed changes. For more information, see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

smustgrave’s picture

@jonathan1055 can you update the MR for 11.x

jonathan1055’s picture

The tests on MR 3273 were OK but now we get one failure
https://git.drupalcode.org/issue/drupal-2895388/-/jobs/564727#L1443

Drupal\Tests\media_library\FunctionalJavascript\WidgetViewsTest::testWidgetViews
    "Loading grid view." not found
    Failed asserting that a boolean is not empty.

Is this related, or some other problem?

Akhil Babu made their first commit to this issue’s fork.

Akhil Babu changed the visibility of the branch 11.x to hidden.

Akhil Babu’s picture

Status: Needs work » Needs review

I have created a new MR against 11.x along with some minor coding standard fixes. Also, upon reviewing the changes,
description table header of core/modules/system/templates/system-modules-uninstall.html.twig uses the priority-medium class while core/themes/claro/templates/admin/system-modules-uninstall.html.twig uses priority-low class. Was this intentional, or was it just a mistake?

smustgrave’s picture

Status: Needs review » Needs work

Multiple MRs not sure what's to be reviewed. Should have 1 MR visible or specify which is the one to be reviewed.

jonathan1055 changed the visibility of the branch 2895388-uninstall-machine-name-filter to hidden.

jonathan1055’s picture

I have hidden MR3273 as that was the original one, on 10.1.x so will not be committed.

@Akhil Babu, can you confim that your first commit on the new MR 6065 for 11.x is exactly the same as was on the 10.2.x MR?

Akhil Babu’s picture

@jonathan1055 Yes, The first commit in 6065 has all the changes from MR 5496. The next 2 commits are for coding standard fixes.

jonathan1055’s picture

Status: Needs work » Needs review

Thanks @Akhil Babu, it looked like that, but better to ask the person who actually did it.

Your quesion in #102

description table header of core/modules/system/templates/system-modules-uninstall.html.twig uses the priority-medium class, while core/themes/claro/templates/admin/system-modules-uninstall.html.twig uses priority-low class. Was this intentional, or was it just a mistake?

I recall that it was difficult to decide which template to base the new one. Should the Claro uninstall match the Claro install or the System Uninstall? I used priority-low because Claro install had that. My thinking was that it was more important to be consistent with Claro, rather than between the two uninstall templates. But happy to change it if that was the wrong decision.

smustgrave’s picture

Status: Needs review » Needs work

Moving to NW for change record updates.

Also believe we need a template for some of the other themes, stable9, maybe starterkit (not 100% on that).