API page: http://api.drupal.org/api/drupal/modules--node--node.module/function/nod...

Describe the problem you have found:

I don't believe it's a problem with the documentation so much as the function. I would expect the node_get_recent function to return the most recently created content. Instead, it appears to return the most recently updated.

Comments

aspilicious’s picture

Version: 7.x-dev » 8.x-dev
Component: node.module » documentation

We fix bugs first in 8.x

This is a documentation issue.

jhodgdon’s picture

Title: Documentation problem with node_get_recent » node_get_recent doc needs to clarify what "recent" means
Issue tags: +Needs backport to D7

Definitely a doc issue.

The query definitely returns nodes ordered by n.changed (the last changed time). Should be documented in the function one-line doc header, which currently says "Find the most recent nodes that are available to the current user." -- which indeed doesn't clarify what "recent" means.

jhodgdon’s picture

Issue tags: +Novice

Probably a good one for a novice doc contributor to take on...

James_Stallings’s picture

Novice contributor here. Looking for an endorsement before I proceed creating a patch.

Change the document header

From: Find the most recent nodes that are available to the current user.

To: Find the most recently changed nodes that are available to the current user.

jhodgdon’s picture

That looks mostly good. But as long as we are fixing this function, we should also bring the doc header up to standards:
http://drupal.org/node/1354

Namely, the one-sentence description should start with "Finds", not "Find".

Thanks!

James_Stallings’s picture

Assigned: Unassigned » James_Stallings

In progress

James_Stallings’s picture

Assigned: James_Stallings » Unassigned
Status: Active » Needs review
StatusFileSize
new492 bytes
jhodgdon’s picture

Status: Needs review » Reviewed & tested by the community

Looks good to me -- congratulations on your first patch (or one of your first few anyway)!

8.x/7.x please... This function doesn't exist in 6.x under this name anyway, so that should do it.

webchick’s picture

Status: Reviewed & tested by the community » Fixed

Great job, James! Thanks! :)

Committed and pushed to 8.x and 7.x.

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