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.)

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

floretan’s picture

The 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.

Jody Lynn’s picture

Version: 7.x-dev » 6.x-dev
Component: node system » documentation

The 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."

jhodgdon’s picture

Issue tags: +Novice

Sounds like a good project for a novice documentation contributor.

dstol’s picture

Assigned: Unassigned » dstol
Status: Active » Needs review
FileSize
858 bytes

I like the phrasing in #3 so I went with it.

jhodgdon’s picture

Status: Needs review » Needs work

If 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

dstol’s picture

Status: Needs work » Needs review
FileSize
1.03 KB

First shot at it... I don't know if the dual param is correct with the pipe.

jhodgdon’s picture

Status: Needs review » Needs work

Sorry 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.

jhodgdon’s picture

But the text looks good. :)

dstol’s picture

Status: Needs work » Needs review
FileSize
773 bytes

Whoops, I know better then that.

jhodgdon’s picture

Status: Needs review » Reviewed & tested by the community

That's better, thanks!

Status: Reviewed & tested by the community » Needs work

The last submitted patch, node-submit-379348-10.patch, failed testing.

jhodgdon’s picture

That's true, I can't apply this patch either now. Not sure what happened...

jhodgdon’s picture

Status: Needs work » Reviewed & tested by the community

Oops, 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.

Gábor Hojtsy’s picture

Status: Reviewed & tested by the community » Fixed

Thanks, committed.

Status: Fixed » Closed (fixed)
Issue tags: -Novice

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