Something that you may need to do one day or another is validating a custom form field value as if it was a Content field existing value, outside of the node form context.
There is something quite sad about Content module, that is the API does not seems (in Drupal 6, at least, I'm awaiting for a lot of improvements in D7 Field API) to expose any function for manual field validation. The whole process of validation goes through the numerous iterations in node_form and in hook_nodeapi() content module's implementation.
I found a way, quite ugly, but tested and working, let's analyse the following code (comments are inside the function)...
Commentaires récents