Come together with the global Drupal community in Rotterdam, 28 Sept – 1 Oct 2026. Sessions, contribution, connection, and Early Bird savings until 8 June.
Okay, the bug was in the feedapi_item.module -- the value '3' was hardcoded in the for loop. here's the corrected feedapi_item_nodeapi() function, also corrected the comment for the function ;-)
I replaced the hardcoded '3' with a reference to the settings value in the $feed object, $feed->settings['processors']['feedapi_item']['promote'] -- is this always valid on the $feed object?
/**
* Implementation of hook_nodeapi().
*/
function feedapi_item_nodeapi(&$node, $op, $teaser, $page) {
switch ($op) {
case 'delete':
$result = db_query("SELECT fiid FROM {feedapi_node_item} WHERE nid = %d", $node->nid);
if (db_num_rows($result) > 0) {
$feed_item = db_fetch_object($result);
feedapi_item_feedapi_item_delete($feed_item);
}
break;
}
if ($op == 'view' && !$teaser && isset($node->feed->nid)) {
$feed = $node->feed;
if (is_array($feed->processors)) {
if (in_array('feedapi_item', call_user_func_array('array_merge', $feed->processors))) {
$items = module_invoke('feedapi_item', 'feedapi_item_fetch_items', $feed);
for ($i = 0; $i != $feed->settings['processors']['feedapi_item']['promote'] && $i != count($items); $i++) {
$list[] = l($items[$i]->title, 'node/'. $items[$i]->nid);
}
$node->content['body']['#value'] .= theme('item_list', $list);
}
}
}
}
Promoted items is about a different thing: The newest N items will be promoted on the front page per feed .
So it's about putting the news items to the front page of the Drupal site.
But I can say too that this behaviour is really a bug, I'll find out how and where possible to adjust this hardcoded value.
There is a new option for feedapi_item processor: "Number of listed news items at feed node:" Here you can adjust the listed items. (instead of the ugly hardcoded value)
Comments
Comment #1
buddaOkay, the bug was in the feedapi_item.module -- the value '3' was hardcoded in the for loop. here's the corrected feedapi_item_nodeapi() function, also corrected the comment for the function ;-)
I replaced the hardcoded '3' with a reference to the settings value in the $feed object,
$feed->settings['processors']['feedapi_item']['promote']-- is this always valid on the $feed object?Comment #2
aron novakPromoted items is about a different thing: The newest N items will be promoted on the front page per feed .
So it's about putting the news items to the front page of the Drupal site.
But I can say too that this behaviour is really a bug, I'll find out how and where possible to adjust this hardcoded value.
Comment #3
aron novakThere is a new option for feedapi_item processor: "Number of listed news items at feed node:" Here you can adjust the listed items. (instead of the ugly hardcoded value)
Comment #4
aron novak