Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
http://api.drupal.org/api/function/node_submit says:
"Prepare node for save and allow modules to make changes."
Module hooks aren't invoked here any more: http://drupal.org/node/114774#nodeapi-presave
(This needs fixing for 6 too.)
Comment | File | Size | Author |
---|---|---|---|
#10 | node-submit-379348-10.patch | 773 bytes | dstol |
#7 | node-submit-379348-7.patch | 1.03 KB | dstol |
#5 | node-save-379348-5.patch | 858 bytes | dstol |
Comments
Comment #1
floretan CreditAttribution: floretan commentedThe function description is false, but taking a closer look at it I'm not sure what that description should be, which might be a sign that the function needs to be refactored to something more logical.
In core, node_submit() only gets called from the blogapi.module and from node_form_submit_build_node() (which itself gets called from node_form_submit()). It looks like the code inside of node_submit() really belongs in a submit handler, which should not get called by other modules.
Comment #3
Jody LynnThe 7.x description has been updated, but the 6.x description should be a bit more like the 7.x one, as 'allow modules to make changes' is inaccurate.
Perhaps, "Prepare node for saving by populating teaser, author, and creation date."
Comment #4
jhodgdonSounds like a good project for a novice documentation contributor.
Comment #5
dstolI like the phrasing in #3 so I went with it.
Comment #6
jhodgdonIf you're going to fix up the doc for this function, maybe we should bring it into compliance with the doc standards at http://drupal.org/node/1354.
- should start with a verb like "prepares" rather than "prepare"
- should be grammatically better, e.g. "Prepares a node" rather than "Prepare node".
- should have @param and @return sections
Comment #7
dstolFirst shot at it... I don't know if the dual param is correct with the pipe.
Comment #8
jhodgdonSorry for the delay - just got around to reviewing this patch.
The patch's doc block is not formatted correctly. Each line of the docblock should start with a space (after the initial /**) so that the *'s line up.
Comment #9
jhodgdonBut the text looks good. :)
Comment #10
dstolWhoops, I know better then that.
Comment #11
jhodgdonThat's better, thanks!
Comment #13
jhodgdonThat's true, I can't apply this patch either now. Not sure what happened...
Comment #14
jhodgdonOops, I take that back. It doesn't apply to D7, but applies fine to D6.
I looked at the error log for the test, and it says "can't find file to patch at input line 8". So the testing bot seems to be the problem, not the patch.
Comment #15
Gábor HojtsyThanks, committed.