For upgrading and maintenance is it possible to create a function that turns off all (selected) modules in the Module Administration page?

Comments

dawehner’s picture

<?php
function disable_all() {
  // get all none core modules(placed in /modules)
  $result = db_query("SELECT name, filename FROM {system} WHERE type = '%s' AND status = %d", 'module', 1);
   while ($item = db_fetch_array($result)) {
      if (strpos($item['filename'], 'modules') !== 0 && strpos($item['filename'], 'modules') !== FALSE) {
       $modules[$item['name']] = $item['name'];
      }
   }
   module_disable($modules);
}
?>

I'm not sure whether this works, you need to backup before running this function!

dave reid’s picture

Version: 6.x-dev » 7.x-dev

Marked #490274: One-click button to disable all contributed modules as a duplicate of this issue. Moving feature requests to Drupal 7.

Bojhan’s picture

Let's put it RIGHT next to module submit on the module page (should be functionality of the misery module) - I am wondering whether we really need this functionality with plugin manager going in.

babbage’s picture

Note this is already implemented in a contributed module for D6, along with better dependency management on the modules page (full disclosure: I am maintainer of the module):
http://drupal.org/project/contrib_toggle

I am looking at porting that code to D7 and that could form part of the basis of the patch requested here. Incidentally, I'm pretty sure there is an earlier issue also requesting this; just couldn't find it immediately.

sun.core’s picture

Version: 7.x-dev » 8.x-dev
wvanbusk’s picture

This will greatly assist core updates. Currently I print the module page to a pdf file. To disable all modules takes four rounds of scanning unchecking and submitting; 80 boxes to uncheck on 24 paged screens and 239 objects submit, 29 boxes, 8 boxes, 5 boxes and done. After moving the files and update.php I use the pdf to restore the previously checked modules by comparing the list of modules to the pdf list. Think of the number of people having to do this globally gives an idea of the amount of time committed to maintenance of each new 0.01 version or drupal. Can we get the drupal server to handle these mundane tasks?

jibran’s picture

Component: update system » base system
Category: feature » task

Module disable status is gone now. Is it still relevant?

dawehner’s picture

Issue summary: View changes
Status: Active » Closed (won't fix)

That sounds like a total contrib module to be honest.

Core updates are now handled using the migrate system which would not need such a switch.