Module Filter
Provides filtering mechanisms for Drupal administration pages including the Extend page, Uninstall page, Update status report, and Permissions page.
module_filter
Install
composer require 'drupal/module_filter:^5.0'
Overview
Module Filter is a Drupal administration enhancement module that provides powerful filtering capabilities for module management pages. The module addresses a common challenge faced by site administrators: finding specific modules on sites with many installed modules.
The module offers text-based filtering that is significantly more effective than browser search features, as it filters elements rather than highlighting matches throughout the entire page. Along with the filter textfield, status checkboxes (Enabled, Disabled, Unavailable) help narrow searches further.
One of the standout features is the optional tabbed interface for the Extend page. Instead of displaying modules as collapsible fieldsets by package, the tabs view converts each package into a vertical tab, greatly improving navigation. Special tabs like 'All', 'Recently enabled', and 'Newly available' provide additional organizational views.
The module also supports advanced filter operators that allow searching by module description, dependencies, and more. Multiple filters can be combined, and the filter state persists across page loads using localStorage.
Features
- Text-based filtering for modules, uninstall, update status, and permissions pages
- Optional tabbed interface for the Extend page that organizes modules by package
- Status checkboxes to filter by Enabled, Disabled, or Unavailable modules
- Filter operators: description: (filter by description), requires: (filter by dependencies), requiredBy: (filter by dependents), perm: (filter by permission text)
- Recently enabled modules tracking with visual highlighting
- Newly available modules detection (modules added within the last week)
- LocalStorage persistence for filter states and preferences
- jQuery UI Autocomplete integration for filter suggestions
- Missing module detection with links to drupal.org project pages
- Tab navigation with browser history support (hash-based URLs)
- Module count display per tab showing enabled/matched modules
- Visual aids showing modules to be enabled/disabled during filtering
Use Cases
Finding a specific module on large sites
On sites with 100+ modules, finding a specific module can be tedious. Type the module name in the filter field to instantly narrow down the list. Use status checkboxes to filter by enabled/disabled state. The tabs interface groups modules by package for additional organization.
Identifying module dependencies
Use the 'requires:' filter operator to find all modules that depend on a specific module. For example, typing 'requires:views' shows all modules that require the Views module. Similarly, 'requiredBy:' shows modules that are required by others.
Reviewing recently changed modules
After enabling or disabling modules, they appear in the 'Recently enabled' tab for one week. This helps track recent changes during development or troubleshooting. New modules (added to the filesystem within the last week) appear in 'Newly available' tab.
Filtering permissions by module
On sites with many modules, the permissions page becomes very long. With the permissions filter enabled, administrators can quickly find permissions by typing module names or permission text. Use 'perm:' operator for permission-specific searches.
Checking for security updates
On the Update status report page, use the radio filters to quickly show only modules with security updates available or unsupported modules that need attention, making security audits more efficient.
Locating module files
Enable 'Show module path' in settings to display each module's filesystem path. This helps developers quickly identify whether modules are in core, contrib, or custom directories.
Tips
- Use double quotes to search for phrases with spaces: 'requires:"chaos tools"'
- Combine multiple filters with spaces: 'description:ctools views' finds modules with 'ctools' in description AND 'views' in name
- Click an active tab to deselect it and return to the 'All modules' view
- When filtering with tabs, non-matching tabs show the count of matching modules, helping locate where matches are
- Hover over modules in 'All' view to see which package tab they belong to (tab highlights)
- The filter value is preserved in the URL query string, allowing you to bookmark filtered views or share links
Technical Details
Admin Pages 1
/admin/config/user-interface/module-filter
Configuration page for Module Filter settings. Allows administrators to customize how the module enhances various admin pages.
Permissions 1
Hooks 7
hook_form_system_modules_alter
Alters the Extend (system modules) form to add filtering capabilities including text filter, status checkboxes, and tabbed/bare interface.
hook_form_system_modules_confirm_form_alter
Preserves the filter value when the module enable/disable confirmation form is displayed.
hook_form_system_modules_uninstall_alter
Adds filtering to the module uninstall page with text filter by module name, description, or machine name.
hook_form_user_admin_permissions_alter
Adds filtering capabilities to the user permissions administration page if enabled in configuration.
hook_theme_registry_alter
Overrides the system-modules-details template to add Module Filter customizations including requires/required-by classes and module path display.
hook_preprocess_system_modules_details
Preprocesses module details to add the module path variable when the 'Show module path' setting is enabled.
hook_help
Provides help text for the Module Filter help page explaining the module's purpose and linking to the drupal.org project page.
Troubleshooting 5
Ensure the jQuery UI Autocomplete module is installed and enabled. Run update.php to execute update 9403 which installs this dependency automatically.
Check Module Filter settings at /admin/config/user-interface/module-filter and ensure 'Enhance the Extend page with tabs' is checked.
Verify that 'Permissions' is enabled in the Filters section of Module Filter settings. Clear Drupal cache after changing this setting.
Module Filter uses localStorage to persist filter states. Ensure localStorage is not blocked by browser settings or privacy extensions.
Module Filter automatically adds drupal.org links for missing dependencies. If links don't appear, ensure JavaScript is enabled and there are no console errors.
Security Notes 3
- The 'administer module_filter' permission should be granted carefully as it provides access to module configuration settings
- Module Filter does not modify any security-related functionality; it only provides UI enhancements for admin pages
- All filtering happens client-side via JavaScript; no sensitive data is transmitted during filtering operations