config_status_bar
This module provides a simple yet essential tool for Drupal site administrators and developers who manage configuration changes. For those new to Drupal, configuration refers to the settings and customizations you make through the user interface (UI), like creating blocks, views, or adjusting site settings. These changes are stored in the database but need to be exported to YAML files in your codebase for version control and deployment.
The Configuration Status Bar adds a status indicator to the admin toolbar, showing at a glance if there are pending configuration changes that haven’t been exported yet. It supports Drupal’s core configuration management and integrates seamlessly with the Configuration Split module for handling environment-specific configs. This helps prevent oversights during development, ensuring your site stays in sync between database and code.
What solution does this module provide? It solves the problem of lacking visibility into configuration changes in the UI, offering a toolbar item that displays the count of changes, groups them by type, and links to the sync page.
Features
The basic functionality is to monitor and display the differences between your active (database) configuration and the synced (file-based) configuration right in the admin toolbar. When enabled, it adds a “Config Status” item that shows “No configuration changes detected” in green if everything is synced, or “Config Status (N)” in red with the number of changes if there are discrepancies.
Unique features include:
- Color-coded status for quick visual feedback (green for synced, red for changes with an exclamation icon).
- A dropdown tray listing changes grouped by configuration type (e.g., “Block: 2 changes”, “Views: 1 change”), providing a concise overview without needing to visit the full sync page.
- Caching of the change list to minimize performance impact on admin pages, with invalidation on config saves/deletes/renames.
- Positioned on the right side of the toolbar for prominence.
Someone would use this module during development or maintenance workflows to stay aware of unsynced changes, avoiding issues like deploying incomplete configs or overwriting changes. Use cases include:
- Multi-developer teams where multiple people edit configs via UI and need reminders to export.
- Sites using Git for version control, to ensure all changes are committed.
- Environments with config splits (e.g., dev/prod differences), as it respects those splits in its comparisons.
- Quick checks during debugging or after module installs/uninstalls that alter configs.
Post-Installation
Once installed and enabled (via `drush en config_status_bar` or the Extend page at /admin/modules), the module works immediately without further configuration. Log in as an admin user with toolbar access, and you’ll see the “Config Status” item on the right side of the admin toolbar.
- If there are no changes, it displays a green message in the tray.
- If changes exist, the tab shows the count in red, and the tray lists grouped changes with a link to /admin/config/development/configuration for detailed sync actions.
No dedicated config page is needed; it leverages Drupal’s core config sync system. Special considerations:
- Clear caches after installation (`drush cr`) to ensure the toolbar updates.
- The status updates on page reload or after config changes (thanks to event-based cache invalidation). For real-time updates, consider adding custom JS (not included).
- If using Configuration Split, ensure it’s configured properly; this module uses the decorated sync storage service automatically.
Additional Requirements
This module requires Drupal core 9 or 10, and depends on the core Toolbar module (which is usually enabled by default). No external libraries, APIs, or additional modules are strictly required for basic functionality.
Recommended modules/libraries
- Admin Toolbar: While not required (as core Toolbar is the dependency), it provides an improved toolbar experience with sub-menus, which complements this status indicator.
- Configuration Split: Enhances handling of environment-specific configurations; this module supports it out-of-the-box for more accurate status reporting.
- Config Ignore: If you want to ignore certain configs from sync, it pairs well to refine what changes are flagged.
Similar projects
Similar modules include:
- Admin Toolbar Extra Tools: Adds various toolbar items, but none dedicated to config status; this is more targeted and includes grouping/caching.
- Config Devel: Provides auto-export on save but lacks a UI status indicator; this module focuses on visibility rather than automation.
- Config Tools: Offers advanced sync features but no toolbar integration; our module is lighter and specifically for quick status checks.
What differentiates this module is its simplicity, performance optimizations (caching), and UX focus with grouped listings and color-coding, making it ideal for everyday awareness without bloat.