diff --git a/core/modules/aggregator/aggregator.admin.inc b/core/modules/aggregator/aggregator.admin.inc index 0763342..e3eedbc 100644 --- a/core/modules/aggregator/aggregator.admin.inc +++ b/core/modules/aggregator/aggregator.admin.inc @@ -70,28 +70,26 @@ function aggregator_view() { $categories = entity_load_multiple_by_properties('taxonomy_term', array('vid' => 'aggregator_categories')); $rows = array(); - if ($categories) { - foreach ($categories as $category) { - $row = array(); - $items = entity_query('aggregator_item') - ->condition('field_aggregator_categories.target_id', $category->id()) - ->execute(); - $row[] = l($category->label(), 'aggregator/categories/' . $category->id()); - $row[] = format_plural(count($items), '1 item', '@count items'); - $links = array(); - $links['edit'] = array( - 'title' => t('Edit'), - 'href' => 'taxonomy/term/' . $category->id() . '/edit', - 'query' => drupal_get_destination(), - ); - $row[] = array( - 'data' => array( - '#type' => 'operations', - '#links' => $links, - ), - ); - $rows[] = $row; - } + foreach ($categories as $category) { + $row = array(); + $items = entity_query('aggregator_item') + ->condition('field_aggregator_categories.target_id', $category->id()) + ->execute(); + $row[] = l($category->label(), 'aggregator/categories/' . $category->id()); + $row[] = format_plural(count($items), '1 item', '@count items'); + $links = array(); + $links['edit'] = array( + 'title' => t('Edit'), + 'href' => 'taxonomy/term/' . $category->id() . '/edit', + 'query' => drupal_get_destination(), + ); + $row[] = array( + 'data' => array( + '#type' => 'operations', + '#links' => $links, + ), + ); + $rows[] = $row; } $output .= '

' . t('Category overview') . '

'; $header = array(t('Title'), t('Items'), t('Operations')); diff --git a/core/modules/aggregator/aggregator.pages.inc b/core/modules/aggregator/aggregator.pages.inc index 6063552..3602e3e 100644 --- a/core/modules/aggregator/aggregator.pages.inc +++ b/core/modules/aggregator/aggregator.pages.inc @@ -329,18 +329,14 @@ function aggregator_page_sources() { * @see aggregator_menu() */ function aggregator_page_categories() { - $result = entity_query('taxonomy_term') - ->condition('vid', 'aggregator_categories') - ->execute(); - $build = array( '#type' => 'container', '#attributes' => array('class' => array('aggregator-wrapper')), '#sorted' => TRUE, ); + $categories = entity_load_multiple_by_properties('taxonomy_term', array('vid' => 'aggregator_categories')); $aggregator_summary_items = config('aggregator.settings')->get('source.list_max'); - foreach ($result as $tid) { - $category = taxonomy_term_load($tid); + foreach ($categories as $category) { $summary_items = array(); if ($aggregator_summary_items) { if ($items = aggregator_load_feed_items('category', $category, $aggregator_summary_items)) { @@ -371,8 +367,7 @@ function aggregator_page_rss() { $category = NULL; $rss_config = config('system.rss'); // arg(2) is the passed cid, only select for that category. - if (arg(2)) { - $category = taxonomy_term_load(arg(2)); + if ($category = menu_get_object('taxonomy_term', 2)) { $items = aggregator_load_feed_items('category', $category, $rss_config->get('items.limit')); } // Or, get the default aggregator items.