Is it possible to perform some action every time the update.php script is run? I'd like my module's hook to be called each time, but I cannot figure a way to do it. I've tried returning '#finished' => 0, from my hook_update_N, but that results in an infinite loop each time update.php is invoked. (Is that a bug or on purpose?) This is drupal 4.7, BTW. Thanks, -Dave
On Thursday 21 September 2006 22:23, Dave Cohen wrote:
Is it possible to perform some action every time the update.php script is run? I'd like my module's hook to be called each time, but I cannot figure a way to do it.
I figured a way. form_alter hooks are called as usual from update.php. Therefore I can use a form_alter hook to always select the appropriate update for my module. Good enough for me.
Dave Cohen wrote:
On Thursday 21 September 2006 22:23, Dave Cohen wrote:
Is it possible to perform some action every time the update.php script is run? I'd like my module's hook to be called each time, but I cannot figure a way to do it.
I figured a way. form_alter hooks are called as usual from update.php. Therefore I can use a form_alter hook to always select the appropriate update for my module. Good enough for me.
or add a submit handler to the update form. see #submit in fapi reference.
On Friday 22 September 2006 01:45, Moshe Weitzman wrote:
Dave Cohen wrote:
I figured a way. form_alter hooks are called as usual from update.php.
or add a submit handler to the update form. see #submit in fapi reference.
Moshe, I appreciate the suggestion and agree that using $form['#submit'] would be a cleaner way to do it. However it doesn't work. Because the various complexities of update.php and the FAPI align in such a way that update.php does not call drupal_get_form after the form is submitted. Therefore the normal form processing does not happen upon submit. Also, just FYI, $form['#submit'] is not documented in either the fapi or quickstart guides for 4.7. (Elements that have a '#submit' attribute are, but not the '#submit' that applies to form).
participants (2)
-
Dave Cohen -
Moshe Weitzman