Closed (fixed)
Project:
Mollom
Version:
7.x-1.x-dev
Component:
Code
Priority:
Normal
Category:
Task
Assigned:
Reporter:
Created:
1 Dec 2009 at 16:07 UTC
Updated:
24 Apr 2014 at 17:13 UTC
Jump to comment: Most recent, Most recent file
Because #645374: Make entity ids available to form submit handlers is committed to Drupal 7, we can remove/simplify the following code in Drupal 7:
/**
* Implements hook_nodeapi().
*/
function mollom_nodeapi($node, $op) {
if ($op == 'insert' && isset($GLOBALS['mollom_response']['session_id'])) {
mollom_set_data('node-' . $node->nid, $GLOBALS['mollom_response']);
}
}
/**
* Implements hook_comment().
*/
function mollom_comment($comment, $op) {
if ($op == 'insert' && isset($GLOBALS['mollom_response']['session_id'])) {
mollom_set_data('comment-' . $comment['cid'], $GLOBALS['mollom_response']);
}
}
| Comment | File | Size | Author |
|---|---|---|---|
| #15 | mollom-HEAD.postid.15.patch | 12.78 KB | sun |
| #14 | mollom-HEAD.postid.14.patch | 12.21 KB | sun |
| #12 | mollom-DRUPAL-6--1.postid.12.patch | 11.67 KB | sun |
| #10 | mollom-DRUPAL-6--1.postid.10.patch | 11.42 KB | sun |
| #8 | mollom-DRUPAL-6--1.postid.8.patch | 11.15 KB | sun |
Comments
Comment #1
dave reidMarking as postponed until we have a Drupal 7 branch.
Comment #2
dries commentedReviving as we now have a CVS HEAD branch that works on Drupal 7.
Comment #3
sunComment #4
dave reidWait, is this for D6 or D7? Example code is D6 code and I think our D7 node/comment hooks look about as simple as they can get...
Comment #5
sunThis is targeting D7. Mollom is now able to use the 'post_id' mapping in its own, generic form submit handler to invoke mollom_data_save().
Comment #6
dave reidGot it. Wasn't clear at all from the original post. Yeah I see now there's not much we can do for the 6.x hooks now.
Comment #7
sunStarting point. This test fails, which is good, because I can now implement the required changes in form processing for this functionality. :)
Comment #8
sunIf there's something that's funky, then this is... überfunky!
Comment #9
sunComment #10
sunFinal tweak: Looking at how Webform handles multi-step forms, we need to add a tiny protection to account for unforeseen form rebuilds.
Comment #11
sunCross-linking the patch for Webform: #686136: Implement hook_mollom_form_info for submission protection by Mollom
Comment #12
sunUpdated the inline comments as requested.
Comment #13
dries commentedCommitted to CVS HEAD. Thanks!
Moving back to D7.
Comment #14
sunStraight forward-port. Untested, but should hopefully work.
Comment #15
sunoh, we can actually test it with core entities now ;)
Also note that I just re-opened #645374: Make entity ids available to form submit handlers with a small patch that will allow us to also kill the hook_ENTITY_delete() hook implementations in mollom.module.
Comment #16
dries commented#645374: Make entity ids available to form submit handlers was committed. I think we should also document this "requirement" or "interaction model" in the Mollom API documentation.
Comment #17
dries commentedCommitted the patch in #15 to help make progress. ;-)
Comment #18
sunThanks!
Since revamping the Mollom feedback options to re-use existing delete confirmation forms requires larger changes anyway, I would consider this issue as fixed then.