So,
after a long hiatus, i'm back. Last night i migrated my site from aggregator2 to leech 4.7 1.3
I created the feeds as a page node type and the items template is a story node type. Everything went well, after a few cron runs each feed had the correct number of items promoted to the frontpage. Then, the frontpage stopped being updated. New feed items were published but not promoted. I found the problem and almost found the solution.
The problem is that once a feed reached the max number of promoted items, no new items are promoted unless the node type of the feed is defaulted to promote to the front page. In my case, if the page node type is not set to promote to the frontpage by default, feed items are not promoted.
I don't know if it was intended to be this way, but it is a serious limitation. In the code, this takes place ~ line 2140 in the 4.7 head.
the code grabs the promote option of the feed node type
$node_options = variable_get('node_options_'. $node->type, array('status', 'promote'))
a few lines later it uses that info to decide wether to promote the item or not. Later that info is used to manage the number of items promoted. anyho here's the code
if ($node->leech_news->items_promote == 1000000000) {
$edit->promote = 1;
}
else if ($node->leech_news->items_promote == 0) {
$edit->promote = 0;
}
else {
$edit->promote = in_array('promote', $node_options);
}
Now, 1000000000 stand for promote all 0 for promote none. I think it is safe to promote the items if items_promote is != of 0. later in the code, the number of promoted items is fixed for each feed. So changing the last block of code to the following should solve the issue.
if ($node->leech_news->items_promote == 0) {
$edit->promote = 0;
}
else {
$edit->promote = 1;
}
Comments
Comment #1
funana commentedI have the same problem on a fresh Drupal 5.1 install. I changed the code like you discribed and run a cron - no changes...
Comment #2
funana commentedItems are promoted now when I leech them one feed by one...
Comment #3
aron novakRemove ugly undocumented behaviour that if at the content-type this is set to non-promoting, the feed items won't show on front page
All branches contains the fix in the CVS.
The suggested code part is ok (thanks zis!), so it's possible to rewrite the old 4.7.x-1.3 package w/ this.
Comment #4
aron novak