I found this through using Mollom on a site where I had disabled previews on a node type for technical reasons. Doing a preview invokes hook_nodeapi() with the 'view' $op, and I was hooking into that to perform a redirect for the nodes after their creation. I have since updated my hook_nodeapi() to check for a $node->nid, but I also think a fix is in order for Mollom... it builds the node preview content for node forms even if it's not set to protect those forms. So in my case, Mollom was invoking my module's hook_nodeapi() and causing the redirect when I didn't want it to.

Anyways, I've attached a patch that will bail out of mollom_validate()if the form's mode is MOLLOM_MODE_DISABLED. I suppose you could alternately not alter the form at all, but I'm not sure it's much faster. : ?

This means we'll save on a node_build_content() and drupal_render() on node form submission where Mollom isn't needed anyways.

CommentFileSizeAuthor
mollom_validate.patch1.13 KBrszrama

Comments

dries’s picture

Status: Active » Fixed

Thanks Ryan. I committed this patch to DRUPAL-5 and I've ported it to the DRUPAL-6 branch as well. All committed to CVS. I probably won't roll a new release yet but could do so if you think that would be important.

rszrama’s picture

"I probably won't roll a new release yet but could do so if you think that would be important."

No worries. We patched it on the affected site, and the conflict is probably in a very small minority of use cases.

Anonymous’s picture

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for two weeks with no activity.