It would be great if a column could be added to the modules list to display the file path of each module. To avoid cluttering the interface, this could even be done with a rollover effect.

The use case for this primarily addresses Drupal multisite users who for one reason or another, have differing versions of a module in sites/all and sites/siteinquestion. For example, sites/all may contain the 7.x-1.x version of the media module, as the majority of sites in the multisite were built before 7.x-2.x was stable, while specific newer sites within the multisite may contain the 7.x-2.x version. In this case, it would be very helpful to have this information available from the module list interface, so that site administrators can determine at a quick glance where the module lives.

I'll take a stab at writing a patch for this and submit it here when complete.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

alexminer’s picture

Status: Active » Needs review
FileSize
2.49 KB

Here is a patch containing the new functionality I described. Currently, there is no rollover to display the path, and it instead adds a new column in which the path is displayed.

This additional column will only appear if the configuration option 'Show module path in modules list' is enabled. By default, this is disabled in order to prevent clutter since this feature primarily targets more advanced users.

alexminer’s picture

helmo’s picture

Here's an updated patch for the 7.x-2.x branch.
Works as expected.

clemens.tolboom’s picture

+++ b/module_filter.theme.inc
@@ -40,6 +40,12 @@ function theme_module_filter_system_modules_tabs($variables) {
+  $show_module_path = variable_get('module_filter_show_path', 0);
+  if ($show_module_path) {
+    $path = array(t('Path'));
+    array_splice($header, 3, 0, $path);
+  }
+
   if (variable_get('module_filter_track_recent_modules', 1)) {

This is unnecessary complicated code.

As the use case is who provides the module the path are probably not important. Why not just match on type like

        $module_path = drupal_get_path('module', $key);
        $types = array(
          'core' => 'modules',
          'profile' => 'profiles/',
          'all' => 'sites/all/modules',
          'site' => 'sites/'
        );

I'm not sure why the column width is so wide :-/

helmo’s picture

I'm not sure why the column width is so wide :-/

Because it had no styling.

This patch sets it to 10% with. And shows the whole path when hovering over the path column.

Yago Elias’s picture

Just fixing a small typo issue on last patch

Yago Elias’s picture

Status: Needs review » Needs work
Issue tags: +ciandt-contrib
FileSize
15.95 KB
24.25 KB

The patch is working fine to me! I can see the paths of my module.

Changing to RTBC

Evidence:

Yago Elias’s picture

Status: Needs work » Reviewed & tested by the community
clemens.tolboom’s picture

Guess this needs a D8 version first?

Yago Elias’s picture

Hi clemens! Im trying to port this feature to d8. Wanna help? https://www.drupal.org/node/2886842

greenSkin’s picture

Assigned: alexminer » Unassigned
Status: Reviewed & tested by the community » Needs review
FileSize
4.46 KB

I'd like to keep the number of columns to a minimum. This patch moves the path into the description column and shows the entire relative path to the module. CSS will clip the path with an ellipsis when it's too long to fit in the column's width. Also moved the setting into the tabs fieldset as this only applies when using tabs.

clemens.tolboom’s picture

Yago Elias’s picture

I liked @greenSkin approach!

Here is the patch with some coding standards issue resolved.

leotorati’s picture

Issue summary: View changes

I successfully tested the last patch and it's working fine.

Only local images are allowed.

Only local images are allowed.

leotorati’s picture

Status: Needs review » Reviewed & tested by the community
leotorati’s picture

Issue summary: View changes
clemens.tolboom’s picture

In #2886842: Add option to display module path on admin/modules table I suggested to move it's patch into this issue and set version here into 8.x-3.x as both are same feature request. We have a backport patch in here for the maintainers to review later on. What do you think?

VladSavitsky’s picture

Tested. Works as expected.

andrey.troeglazov’s picture

  • greenSkin authored f40741a on 7.x-2.x
    Issue #2403371 by Yago Elias, helmo, clemens.tolboom, alexminer,...
andrey.troeglazov’s picture

Status: Reviewed & tested by the community » Fixed

Status: Fixed » Closed (fixed)

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