<div dir="ltr">Hello there,<br><br>I'm new to Drupal, just started a couple of weeks ago. I had following queries regarding hooks. It would be great if someone could provide feedback/suggestions on this.<br><br>1. I have written a module which implements "hook_user" and handles "update" and "insert" operations. I want to be able to signal failure/ success from this function. For e.g. if I return failure (boolean FALSE) from "hook_user" for "update" operation, then user update should not happen. I want to do this for "insert", "update" and "delete" operations.<br>
<br> * Is it possible to indicate failure in this way so that update/ insert/ delete will not take place?<br> * If yes, how can I accomplish this?<br><br>2. Also, I quickly glanced through the user.module. At the top there is a function called "user_module_invoke" which takes care of invoking "hook_user" in various modules. But it does not check for return value, nor does it return anything. So probably result of invoking a hook_user is never checked.<br>
<br>If Drupal hooks currently don't check for return value, would it be good idea to add such a functionality? A "pre-operation" hook, which will indicate (boolean TRUE/ FALSE) if the operation should continue or not. Such a hook could be used for various validations when Drupal is integrated with some third-party applications. Any takers for this?<br>
<br>Do reply.<br>Thanks in anticipation,<br>Pushyamitra
</div>