Even though I set 'Forms don't submit:' to 100%, the users that are supposed to endure Misery are still able to send messages.

Comments

danielb’s picture

Can you give more information?
Do other misery options work?
Do other forms prevent submission?
Have you tested it yourself and tried to submit any other forms?

white_pawn’s picture

All other options work, and other forms don't submit. Spammers are still able to send messages. Tested it myself. Using Privatemsg v1.3.

danielb’s picture

I've identified the problem is that misery attaches itself to the $form['#validate'] whereas in that form it uses a #validate set on the submit function.

danielb’s picture

Status: Active » Closed (won't fix)

I don't think I'm gonna be able to fix this using any reasonable means.

You can fix this by creating this hook implementation in your custom module:

<?php

/**
 * Implementation of hook_form_alter().
 */
function YOURMODULE_form_privatemsg_new_alter(&$form, $form_state, $form_id) {
  $form['privatemsg']['preview']['#validate'][] = 'misery_form_validate';
  $form['privatemsg']['submit']['#validate'][] = 'misery_form_validate';
}

?>

None of the functionality in this module is really guaranteed to work 100% of the time, it will annoy the user where it can, I guess, but shouldn't be relied on for blocking users from the site, etc...

If someone can suggest an alternate solution that doesn't have too much of an impact on normal form loading times, etc.. please suggest.