On Tue, Jun 24, 2008 at 7:50 PM, Michael Prasuhn <mike@mikeyp.net> wrote, about module_invoke():
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?
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. Using module_invoke() here would be bad practice at best, but could also be dangerous. Damien Tournoud