blog-banner

Cleanup of Drupal Modules Folders

  • Cleanup
  • Drupal Module
  • Drupal Planet

Clean Drupal Files Entity

Keeping your drupal modules folder very clear is an important part of development. This is the common structure :

  • Contrib - modules from Drupal.org
  • Custom - modules developed for the specific project
  • Features - exported features for Features-driven development

This structure will give a better understanding of the modules to other developers and prevent them from hacking Drupal's contributed modules.

In my case, all the contrib, custom, and features were placed in a single folder (sites/all/modules/). So the modules folder had nearly a hundred modules, it's too irritating for any developer. So I planned to move all the modules to their corresponding folders according to the common drupal folder structure. There were many issues after moving all the modules into specific folders.

Drupal's Registry rebuild module gave the opportunity to clear the registry through CLI (drush/php)

  1. Backup your database,
  2. Download and place the registry_rebuild module into your drupal modules folder,
  3. Move all the modules into their corresponding folders,
  4. Run drush rr command to clear all the registry in the database.

After clearing the registry the site is working like a charm and it's a big relief for any developer.

Get awesome tech content in your inbox