I keep learning every day - and I'm glad to know about hook_enable(), which I didn't know about.<br><br>I don't think it answers my question, though, since I'm concerned about taking actions at install time, which would be hook_install(). And in my particular case, the install actions are the same as the set of hook_update_N(). The only way I know to include all those in hook_install() is either to duplicate code or to make a runner function. Both ugly.<br>
<br>-Randy<br><br><div class="gmail_quote">On Thu, Nov 12, 2009 at 2:35 AM, Ken Rickard <span dir="ltr"><<a href="mailto:agentrickard@gmail.com">agentrickard@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<div class="im">To run an action the first time a module is installed, use<br>
hook_enable() in D5 or D6.<br>
<br>
- Ken<br>
<br>
On Thu, Nov 12, 2009 at 5:08 AM, Randy Fay <<a href="mailto:randy@randyfay.com">randy@randyfay.com</a>> wrote:<br>
</div><div><div></div><div class="h5">> I'm doing a module for infrastructure which is all about applying<br>
> configuration updates, and it does only configuration, nothing else.<br>
> I'd like to create hook_update_N() functions, but I'd also like all of them<br>
> to be run when the module is installed.<br>
> Is there any "correct" way to do this? Many modules implement the<br>
> functionality in both hook_install and hook_update_N, and that's fine for<br>
> database-only issues, which is what these were built around (like schema<br>
> changes). But it doesnt' really make sense for site config changes.<br>
> Obviously, I can run the hook functions from hook_install(), in direct or<br>
> indirect ways.<br>
> Suggestions?<br>
> Thanks,<br>
> -Randy<br>
> --<br>
> Randy Fay<br>
> Drupal Development, troubleshooting, and debugging<br>
> <a href="mailto:randy@randyfay.com">randy@randyfay.com</a><br>
> +1 970.462.7450<br>
><br>
><br>
<br>
<br>
<br>
</div></div>--<br>
<div><div></div><div class="h5">Ken Rickard<br>
<a href="mailto:agentrickard@gmail.com">agentrickard@gmail.com</a><br>
<a href="http://ken.therickards.com" target="_blank">http://ken.therickards.com</a><br>
</div></div></blockquote></div><br><br clear="all"><br>-- <br>Randy Fay<br>Drupal Development, troubleshooting, and debugging<br><a href="mailto:randy@randyfay.com">randy@randyfay.com</a><br>+1 970.462.7450<br><br>