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.
| Comment | File | Size | Author |
|---|---|---|---|
| #14 | node_feed_doc-1196310-14.patch | 565 bytes | barbi |
| #8 | node_feed_doc-1196310-8.patch | 456 bytes | barbi |
| #5 | node_feed_doc-1196310-5.patch | 474 bytes | barbi |
Comments
Comment #1
jhodgdonThanks for reporting! We fix in 8.x then port back to 7.x.
Comment #2
jhodgdonIt 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.
Comment #3
James_Stallings commentedProposed header: A function used to generate a RSS feed from a set of nodes directly to the browser.
Comment #4
jhodgdonThat doesn't comply with our standards -- doesn't need to say "A function...", should start with a verb:
http://drupal.org/node/1354#functions
Comment #5
barbi commentedComment #6
JamesK commentedThe 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.
Comment #7
James_Stallings commentedPrints 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 :|
Comment #8
barbi commentedComment #9
jhodgdonnodes IDs ==> node IDs.
And should we mention that it sends HTTP headers as well?
Comment #10
JamesK commented"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.
Comment #11
jhodgdonNeeds 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.
Comment #12
barbi commentedHow about this?
Generates a RSS feed from an array of node IDs and prints it with Content
Type HTTP header set to RSS/XML.
Comment #13
jhodgdonSlight 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:
i.e., short one-line description, and more details as a second paragraph?
Comment #14
barbi commentedComment #15
jhodgdonLooks fine, thanks! 8.x/7.x please.
Comment #16
webchickCommitted and pushed to 8.x and 7.x. Thanks!