v1.2.0 - Critical Taxonomy Usage Detection Fix
Critical Bug Fix
Problem: All taxonomy terms were incorrectly reported as 'Not used (safe to delete)' regardless of actual usage. This affected production sites where terms had thousands of node references.
Root Cause: Scout only queried the taxonomy_index table, but many Drupal sites (including those with field-based taxonomy) don't populate this table. All usage data resides in node__field_* tables instead.
Solution: Enhanced taxonomy usage detection to query BOTH:
- taxonomy_index table (for sites that use it)
- All node__field_* tables directly (for field-based taxonomy)
This ensures accurate usage detection regardless of site configuration.
Changes
- Enhanced _get_term_usage_from_drush() to query field data tables directly
- Added verify_database_connection() for pre-flight connectivity checks
- Added check_module_enabled() to validate required modules
- Enhanced error handling in run_drush_command()
- Added check_scout_health() tool for diagnostics
- Enhanced get_watchdog_logs() with dblog module check
- Added comprehensive diagnostics to show query methods and results
Testing
- Tested on DDEV development site with real taxonomy data
- All 31 tests passing
Breaking Changes
None - backward compatible with all existing Scout deployments