Skip to content
Snippets Groups Projects
Commit 7c1425b9 authored by Alex Barth's avatar Alex Barth
Browse files

Fix node deletion.

parent 141a8d44
No related branches found
No related tags found
No related merge requests found
...@@ -123,9 +123,11 @@ class FeedsNodeProcessor extends FeedsProcessor { ...@@ -123,9 +123,11 @@ class FeedsNodeProcessor extends FeedsProcessor {
} }
$count = $this->getLimit(); $count = $this->getLimit();
$nodes = db_query_range("SELECT n.nid FROM {node} n JOIN {feeds_node_item} fni ON n.nid = fni.nid WHERE fni.id = :id AND n.created < :created", 0, $count, array(':id' => $this->id, ':created' => REQUEST_TIME - $time)); $nodes = db_query_range("SELECT n.nid FROM {node} n JOIN {feeds_node_item} fni ON n.nid = fni.nid WHERE fni.id = :id AND n.created < :created", 0, $count, array(':id' => $this->id, ':created' => REQUEST_TIME - $time));
$nids = array();
foreach ($nodes as $node) { foreach ($nodes as $node) {
_feeds_node_delete($node->nid); $nids[$node->nid] = $node->nid;
} }
node_delete_multiple($nids);
if (db_query_range("SELECT 1 FROM {node} n JOIN {feeds_node_item} fni ON n.nid = fni.nid WHERE fni.id = :id AND n.created < :created", 0, 1, array(':id' => $this->id, ':created' => REQUEST_TIME - $time))->fetchField()) { if (db_query_range("SELECT 1 FROM {node} n JOIN {feeds_node_item} fni ON n.nid = fni.nid WHERE fni.id = :id AND n.created < :created", 0, 1, array(':id' => $this->id, ':created' => REQUEST_TIME - $time))->fetchField()) {
return FEEDS_BATCH_ACTIVE; return FEEDS_BATCH_ACTIVE;
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment