Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Drupal Module Development : Uninstall/Reinstall/Repeat?

I'm developing a custom module for Drupal on my local machine.

When I edit my code, the changes are never applied right away. So, I go to Administer Modules, and uninstall, and then reinstall my module. This is cycle of uninstall-install-develop-repeat is slow and tedious.

Is there a better way to do it?

My module makes extensive use of Drupal framework so I'm not sure developing it exclusively in PHP first is an option.

like image 267
rlb.usa Avatar asked Mar 24 '11 16:03

rlb.usa


2 Answers

I would highly recommend installing the Devel module. It is very useful while developing for Drupal. Once installed, you can enable the Devel block which is extremely useful. It has a list of links to perform somewhat tedious tasks faster, such as emptying the cache, reinstalling modules, rebuilding the menus, etc.

Many of the changes to your module should not require visiting the modules page. You mostly see the need to do this when you are changing the menu with hook_menu() in your module, as the menus are only rebuilt when visiting that page (or using Devel block "Rebuild Menus" link ;) )

like image 153
Laxman13 Avatar answered Nov 15 '22 08:11

Laxman13


When uninstall/install, the only things that is executed is what is in .install file.

If you don't change this file, you don't have to uninstall/install the module.

Maybe your problem is just a cache issue. Drupal strongly cache a lot a things. And when you enable a module, the cache is cleared. You can clear you cache manually.

On an other hand, I recommand to look on Drush that allow you to do those things faster. (clear cache, enable/disable a module/...)

like image 39
Haza Avatar answered Nov 15 '22 08:11

Haza