Hi,<br><br>> My understanding is that creating a function called<br>><br>> mymodule_invoke_dosomething()<br>><br>> will cause Drupal (via module_invoke_all() ?) to call functions in other<br>> modules called othermodule_dosomething()<br>
><br>> Is there another step in hook creation that I'm missing?<br><br>You need to call <span style="color: rgb(51, 102, 255);">module_invoke_all</span> giving the name of the hook that you want to invoke as the first parameter, and the rest of the parameters of the hook. It will return a merged array of all the results from those modules that implement that hook. See: <a href="http://api.drupal.org/api/function/module_invoke_all/6">http://api.drupal.org/api/function/module_invoke_all/6</a><br>
<br>You <i>may</i> want to put the call to <span style="color: rgb(51, 102, 255);">module_invoke_all</span> in a wrapper function in <i>your</i> module, which <span style="color: rgb(51, 102, 255);">mymodule_invoke_hookname</span> would be a good place, but there's no hard and fast rule AFAIK.<br>
<br>> I agree - I'm just wondering if we (maybe me) could automate the<br>> creation of the hook_nodapi page.<br><br>It is! a.d.o checks out a file from CVS, <a href="http://cvs.drupal.org/viewvc.py/drupal/contributions/docs/developer/hooks/">http://cvs.drupal.org/viewvc.py/drupal/contributions/docs/developer/hooks/</a>, and that's where the <a href="http://api.drupal.org/api/function/hook_nodeapi/6">http://api.drupal.org/api/function/hook_nodeapi/6</a> page comes from.<br>
<br>> - and at the same time look for functions that are implementations of<br>> the hook so that the hook_nodapi references has links to all the places<br>> the hook is used.<br><br>They'll need to be named <span style="color: rgb(51, 102, 255);">modulename_nodeapi</span> so finding implementations is fairly trivial, just use the search box on a.d.o and type in: "_nodeapi"<br>
<br>Also, we're getting a little off-topic here :-D<br><br>On Tue, Jun 3, 2008 at 12:22 PM, Sean Burlington <<a href="mailto:sean@practicalweb.co.uk">sean@practicalweb.co.uk</a>> wrote:<br>> Steven Jones wrote:<br>
>> I wouldn't say that node_invoke_nodeapi 'defined' the nodeapi hook. It<br>>> invokes it, because module_invoke_all can't handle references.<br>><br>> My understanding is that creating a function called<br>
><br>> mymodule_invoke_dosomething()<br>><br>> will cause Drupal (via module_invoke_all() ?) to call functions in other<br>> modules called othermodule_dosomething()<br>><br>> Is there another step in hook creation that I'm missing?<br>
><br>><br>>> But I think that for people looking for how to use the nodeapi hook<br>>> are much more likely to tap 'hook_nodeapi' into a.d.o. You don't need<br>>> knowledge of how the hook is invoked to implement it, you just need to<br>
>> know what parameters you get etc.<br>>><br>><br>> I agree - I'm just wondering if we (maybe me) could automate the<br>> creation of the hook_nodapi page.<br>><br>> - and at the same time look for functions that are implementations of<br>
> the hook so that the hook_nodapi references has links to all the places<br>> the hook is used.<br>><br>> This would be especially useful for my use of the API module on sites I<br>> work on - where I would be able to look (for example) for all the places<br>
> the site uses hook_form_alter().<br>><br>><br>><br>> --<br>><br>> Sean Burlington<br>><br>> <a href="http://www.practicalweb.co.uk">www.practicalweb.co.uk</a><br>> company number 06427950<br>
><br>> --<br>> Pending work: <a href="http://drupal.org/project/issues/documentation/">http://drupal.org/project/issues/documentation/</a><br>> List archives: <a href="http://lists.drupal.org/pipermail/documentation/">http://lists.drupal.org/pipermail/documentation/</a><br>
><br><br><br><br>-- <br>Regards<br>Steven Jones<br>