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

Describe the problem you have found:

The PhpDoc does not say that this method actually prints the feed directly to the browser. I know that there is no @return value in the PhpDoc, but no information of direct print either. "A generic function for generating RSS feeds from a set of nodes." could be interepreted as a return string.

  drupal_add_http_header('Content-Type', 'application/rss+xml; charset=utf-8');
  print $output;

For smart IDEs with IntelliSense support. A note that this will print it directly will be nice.

Comments

jhodgdon’s picture

Title: Documentation problem with node_feed » node_feed doc does not conform to standards
Version: 7.2 » 8.x-dev
Issue tags: +Needs backport to D7

Thanks for reporting! We fix in 8.x then port back to 7.x.

jhodgdon’s picture

Issue tags: +Novice

It seems that we just need to change the one-line description for this function to something that says it sends the feed to the browser, rather than what it is now. Probably a good project for a novice doc contributor.

James_Stallings’s picture

Proposed header: A function used to generate a RSS feed from a set of nodes directly to the browser.

jhodgdon’s picture

That doesn't comply with our standards -- doesn't need to say "A function...", should start with a verb:
http://drupal.org/node/1354#functions

barbi’s picture

Assigned: Unassigned » barbi
Status: Active » Needs review
StatusFileSize
new474 bytes
JamesK’s picture

Status: Needs review » Needs work

The content generated by this function is likely to be captured by things other than a browser. Perhaps there is a more generic way of stating the output.

James_Stallings’s picture

Prints a generated RSS feed from a set of nodes.

From a set of nodes may be unnecessary since we have parameters to specify it.

I'm really bad at technical writing :|

barbi’s picture

Status: Needs work » Needs review
StatusFileSize
new456 bytes
jhodgdon’s picture

Status: Needs review » Needs work

nodes IDs ==> node IDs.

And should we mention that it sends HTTP headers as well?

JamesK’s picture

"Renders and prints an RSS-formatted XML document given an array of node IDs."

I think this covers the idea of HTTP headers without getting so technical since it can't be an "RSS-formatted XML document" without them.

jhodgdon’s picture

Needs a comma after document, IMO. But actually no, what we're talking about is HTTP headers, not XML headers. You can perfectly well print an XML-formatted document without sending the HTTP headers from this particular function.

barbi’s picture

How about this?
Generates a RSS feed from an array of node IDs and prints it with Content
Type HTTP header set to RSS/XML.

jhodgdon’s picture

Slight rewording:

Generates an RSS feed from an array of node IDs, and prints it with an HTTP header, with Content Type set to RSS/XML.

So this looks good, but I'm pretty sure it's more than 80 characters. So how about:

Generates and prints an RSS feed.

Generates an RSS feed from an array of node IDs, and prints it with an HTTP header, with Content Type set to RSS/XML.

i.e., short one-line description, and more details as a second paragraph?

barbi’s picture

Status: Needs work » Needs review
StatusFileSize
new565 bytes
jhodgdon’s picture

Status: Needs review » Reviewed & tested by the community

Looks fine, thanks! 8.x/7.x please.

webchick’s picture

Status: Reviewed & tested by the community » Fixed

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

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