Windows XP Pro SP2 (Everything current)
Apache 2.2.4/(Win32) PHP 5.2.4
MySQL v5.0.45-community-nt
New installation of Drupal 6.0 Beta 4 (not previously installed).
No Blogs configured.
New User Created. First time login
Left Menu is:
Blogs
Books
Compose tips
Forums
My account
Polls
Recent posts
Log out
New user clicks the left menu to go to Blogs, then the RSS Feed image to go to the Feeds and then hits the IE (v7.0.5730.11) Back Button to get:
Home
Blogs
warning: Invalid argument supplied for foreach() in D:\home\vbw\modules\node\node.module on line 1523.
Pressing the Refresh button removes the error and the page is back to what it was before pressing the image to go to the Feeds
Lines 1500 to 1542 from node.module
/**
* A generic function for generating RSS feeds from a set of nodes.
*
* @param $nids
* An array of node IDs (nid).
* @param $channel
* An associative array containing title, link, description and other keys.
* The link should be an absolute URL.
*/
function node_feed($nids = array(), $channel = array()) {
global $base_url, $language;
if (!$nids) {
$result = db_query_range(db_rewrite_sql('SELECT n.nid, n.created FROM {node} n WHERE n.promote = 1 AND n.status = 1 ORDER BY n.created DESC'), 0, variable_get('feed_default_items', 10));
while ($row = db_fetch_object($result)) {
$nids[] = $row->nid;
}
}
$item_length = variable_get('feed_item_length', 'teaser');
$namespaces = array('xmlns:dc' => 'http://purl.org/dc/elements/1.1/');
$items = '';
foreach ($nids as $nid) {
// Load the specified node:
$item = node_load($nid);
$node->build_mode = NODE_BUILD_RSS;
$link = url("node/$nid", array('absolute' => TRUE));
if ($item_length != 'title') {
$teaser = ($item_length == 'teaser') ? TRUE : FALSE;
// Filter and prepare node teaser
if (node_hook($item, 'view')) {
$item = node_invoke($item, 'view', $teaser, FALSE);
}
else {
$item = node_prepare($item, $teaser);
}
// Allow modules to change $node->teaser before viewing.
node_invoke_nodeapi($item, 'view', $teaser, FALSE);
}
Comment | File | Size | Author |
---|---|---|---|
#2 | blogrssfixl.patch | 805 bytes | Nick Lewis |
Comments
Comment #1
Nick Lewis CreditAttribution: Nick Lewis commentedVerified on Head.
Comment #2
Nick Lewis CreditAttribution: Nick Lewis commentedOne line fix.
Comment #3
Nick Lewis CreditAttribution: Nick Lewis commentedBumping this up, since it was so easy to fix. Making the items an array was literally all that was wrong. Pretty self evident.
Comment #4
Gábor HojtsyThanks. The very same initialization code exists in blog_feed_user() just a bit above, but was missing from here. Committed.
Comment #5
(not verified) CreditAttribution: commentedAutomatically closed -- issue fixed for two weeks with no activity.