I've written a patch to path.module that auto-generates path aliases - see http://drupal.org/node/14546 - but has now decided to move it to a module.

This module should do it's work after the user has pressed preview or submit, but before validation. As I understand it, there is no hook for this. So the best place seams to be the nodeapi 'validate' hook. Correct?

Now my first problem is: after I added the auto-generated alias, I would like the path.module to verify it. Is there any way to ensure that my modules 'validate' hook is executed before the path modules validate?

Or would it be a better idea to explicitly call path_nodeapi(&$node, 'validate', $arg)? It would make the validate function run twice (once from my module, once from path.module, but I suppose that would be acceptable).

My second problem: Is there any way I can modify the help text of the path modules 'form pre'-hook, in order to inform the user that a path will be automaticly generated if he leaves the field empty?

Comments

killes@www.drop.org’s picture

Currently, module hooks are invoked in alphabetical order, ie if you want to make yure your hooks get invoked before the path module's ones, give it a name that is before p in the alphabet.
I would not bother about the help texts too much: Rather disallow the form for people and make your own "form pre" form.

--
If you have troubles with a particular contrib project, please consider to file a support request. Thanks.