Running only one update on update.php

23 Aug 2009
Posted by doq

Sometimes when developing custom Drupal modules it becomes useful to test only one hook_update_N() implementation but there are already many others added after that. This simple patch will force Drupal to perform only selected update for specified module:

Index: update.php
===================================================================
--- update.php	(revision 0)
+++ update.php	(working copy)
@@ -268,6 +268,7 @@
       foreach ($updates as $update) {
         if ($update >= $version) {
           $operations[] = array('update_do_one', array($module, $update));
+          break;
         }
       }
     }

AttachmentSize
D6-one-update-at-time.patch360 bytes
Tags:  | 

Comments

Post new comment

The content of this field is kept private and will not be shown publicly.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Allowed HTML tags: <a> <em> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd>
  • Lines and paragraphs break automatically.

More information about formatting options

 
 
 
If you have found mistakes in the text then please select it and press Ctrl-Enter to send report to the site administrator.