summaryrefslogtreecommitdiff
path: root/modules/aggregator/aggregator.module
diff options
context:
space:
mode:
authorwebchick <webchick@24967.no-reply.drupal.org>2012-04-28 23:08:34 -0700
committerwebchick <webchick@24967.no-reply.drupal.org>2012-04-28 23:08:34 -0700
commit060eb35f0ae4cde353a0048a6da0818b2fd5fb35 (patch)
treec10e675df649e6023019056bdaf26a88083bfe2c /modules/aggregator/aggregator.module
parente03e94f41e51f043be44daeadb090df3b92de929 (diff)
downloadbrdo-060eb35f0ae4cde353a0048a6da0818b2fd5fb35.tar.gz
brdo-060eb35f0ae4cde353a0048a6da0818b2fd5fb35.tar.bz2
Issue #1058754 by Yaron Tal, kathyh, naxoc, xjm, tim.plunkett: Fixed Attempt to loop through undefined result set in aggregator.
Diffstat (limited to 'modules/aggregator/aggregator.module')
-rw-r--r--modules/aggregator/aggregator.module8
1 files changed, 6 insertions, 2 deletions
diff --git a/modules/aggregator/aggregator.module b/modules/aggregator/aggregator.module
index d320328ef..686f4248a 100644
--- a/modules/aggregator/aggregator.module
+++ b/modules/aggregator/aggregator.module
@@ -397,6 +397,7 @@ function aggregator_block_view($delta = '') {
if (user_access('access news feeds')) {
$block = array();
list($type, $id) = explode('-', $delta);
+ $result = FALSE;
switch ($type) {
case 'feed':
if ($feed = db_query('SELECT fid, title, block FROM {aggregator_feed} WHERE block <> 0 AND fid = :fid', array(':fid' => $id))->fetchObject()) {
@@ -414,9 +415,12 @@ function aggregator_block_view($delta = '') {
}
break;
}
+
$items = array();
- foreach ($result as $item) {
- $items[] = theme('aggregator_block_item', array('item' => $item));
+ if (!empty($result)) {
+ foreach ($result as $item) {
+ $items[] = theme('aggregator_block_item', array('item' => $item));
+ }
}
// Only display the block if there are items to show.