Pergunta

I'm working on creating a module and I'm slowly getting familiar with the Field API and what all settings work on various fields and what don't. While I'm doing this, it seems that the only way to update a custom content type is to disable the module, uninstall it, then re-enable it.

Is there an easy way to do this? Right now, it's a somewhat laborious process that requires a handful of clicks to do the same thing over and over. I'm looking for a script or module to handling this very quickly with (ideally) a single click.

Foi útil?

Solução

Solution 1. Devel + Drush:

You can use devel drush command for module re-installation with all the module dependencies:

drush devel-reinstall modulename

There is also alias for this command

drush dre modulename

Solution 2. Drush:

This is something that I would typically use drush for

drush pm-disable mymodule
drush pm-uninstall mymodule
drush pm-enable mymodule

You could also use it to define your own custom commands to combine these into a single command.

Outras dicas

If you don't have shell access the Devel module provides such functionality. Install it and visit mysite.com/devel/reinstall.

For those of you that want a script that does the devel command without the devel: https://github.com/nategd/drupal_module_restart

Licenciado em: CC-BY-SA com atribuição
Não afiliado a drupal.stackexchange
scroll top