<br><div class="gmail_quote">On Tue, Jun 24, 2008 at 7:50 PM, Michael Prasuhn <<a href="mailto:mike@mikeyp.net">mike@mikeyp.net</a>> wrote, about module_invoke():<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
I don't buy it. This looks like an excellent use of an existing function that does exactly what is called for. What defines a 'hook' anyway? Is a function not a hook if only one module implements it? Would it be such a stretch to think of every function as a hook to be invoked in multiple different ways?<br>
</blockquote><div><br>It doesn't make sense to use module_invoke() in the stated case (calling a specific API function of a module). module_invoke() does not do any error checking, and it does not report anything useful. You should call drupal_functon_exists() directly and act accordingly in case of errors.<br>
<br>Using module_invoke() here would be bad practice at best, but could also be dangerous.<br><br>Damien Tournoud<br><br></div></div>