Closed (fixed)
Project:
Privatemsg
Version:
6.x-2.x-dev
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
4 Jun 2011 at 18:50 UTC
Updated:
24 Jun 2011 at 08:31 UTC
Jump to comment: Most recent file
Comments
Comment #1
sunButton-level submit handlers are a pain.
See #674692: Node module integration tests for a directly related Mollom issue.
See #1150756: Improve integration with entity form button-level and form-level submit handlers, form/entity (re-)building, and previews for a corresponding D8 core issue.
Comment #2
berdirBetter? :)
Comment #3
berdirForgot privatemsg_forward.module...
Comment #4
ufku commentedMollom is ok with the patch.
Comment #5
sunThis likely means that Mollom won't be invoked for previews, right?
As mentioned above, the situation for how to handle button-level and form-level submit handlers throughout Drupal isn't entirely clear. But since this pattern exists at least in Node module and Mollom thus needs to support it anyway, an alternative would be to enhance Mollom's module integration API to allow modules to define the form key to attach its form handlers to.
That, however, would still require privatemsg to fully follow Node module's weird construct; i.e., the button-level submit handler invokes all form-level submit handlers. By default, without that special construct, button-level #submit handlers will not execute form-level #submit handlers.
Powered by Dreditor.
Comment #6
berdirYes, it won't work for the preview. Not sure how much of a problem that is, though.
Because what isn't visible in that patch is that Preview button is now optional and in fact disabled by default. And even if enabled, the form is still protected, the only problem is that you will get an eventual confirmation CAPTCHA only when actually submitting the form and not previewing it.
Comment #7
sunIf this patch works for you, then I guess it's ok.
Mollom is still invoked for previews, because it mainly acts as a form validation handler.
Mollom's form submit handling logic only stores the final result; i.e., to be able to report a post to Mollom later on.
Thus, as long as Mollom is invoked after the primary #submit handler of privatemsg for the (non-preview) 'submit' action, then everything should be fine.
Comment #8
berdirOk. Yes, after a preview, you still need to submit it again, just like you would when you haven't previewed.
Commited this patch to 6.x-2.x.
In 7.x-2.x, we already did it like that to prevent a possible bug, triggered by some dev versions of organic groups.