Last Updated: February 25, 2016
·
666
· webbj74

Find redundant modules

Redundant modules in your Drupal docroot (or even themes with the same names as modules) can cause very erratic behavior in Drupal. For example Drupal and Drush have a slightly different way of determining the path to active modules & themes. Here is a shell command one-liner to find potential faults:

Linux or Mac OS:

$ find /path/to/docroot -name "*.info" -type f | grep -oe "[^/]*\.info" | sort | uniq -d | xargs -I{} find . -name "{}"

Windows msysgit (in msysgit's grep you can't grep -o):

$ find /path/to/docroot -name "*.info"| sed -e 's#\./\(.*\)/\([^/]*\.info\)#\2#g' | sort | uniq -d | xargs -i{} find . -name "{}"

Note: In Drupal 7 there are false-positives for drupalsystemlistingcompatibletest and drupalsystemlistingincompatibletest.