diff --git a/core/modules/aggregator/aggregator.admin.inc b/core/modules/aggregator/aggregator.admin.inc index a5478a4..0763342 100644 --- a/core/modules/aggregator/aggregator.admin.inc +++ b/core/modules/aggregator/aggregator.admin.inc @@ -67,13 +67,11 @@ function aggregator_view() { // Only show the categories table if we actually have an aggregator_categories // vocabulary. If user deletes it, no point giving a broken link. if (taxonomy_vocabulary_load('aggregator_categories')) { - $result = entity_query('taxonomy_term') - ->condition('vid', 'aggregator_categories') - ->execute(); + $categories = entity_load_multiple_by_properties('taxonomy_term', array('vid' => 'aggregator_categories')); $rows = array(); - if ($result) { - foreach (entity_load_multiple('taxonomy_term', $result) as $category) { + if ($categories) { + foreach ($categories as $category) { $row = array(); $items = entity_query('aggregator_item') ->condition('field_aggregator_categories.target_id', $category->id()) diff --git a/core/modules/aggregator/aggregator.module b/core/modules/aggregator/aggregator.module index 43f3210..31ec343 100644 --- a/core/modules/aggregator/aggregator.module +++ b/core/modules/aggregator/aggregator.module @@ -232,13 +232,7 @@ function aggregator_menu() { * FALSE otherwise. */ function _aggregator_has_categories() { - $categories = array(); - if ($vocabulary = taxonomy_vocabulary_load('aggregator_categories')) { - $categories = entity_query('taxonomy_term') - ->condition('vid', $vocabulary->id()) - ->execute(); - } - return user_access('access news feeds') && !empty($categories); + return user_access('access news feeds') && (bool) db_query_range("SELECT 1 FROM {taxonomy_term_data} WHERE vid = 'aggregator_categories'", 0, 1)->fetchField(); } /** @@ -354,7 +348,7 @@ function aggregator_menu_local_tasks(&$data, $router_item, $root_path) { } // Add edit link to 'taxonomy/term/*/edit' // on pages that start with 'aggregator/categories/%'. - if (strpos($root_path, 'aggregator/categories/%') === 0 && $term = array_pop($router_item['page_arguments'])) { + if (strpos($root_path, 'aggregator/categories/%') === 0 && $term = end($router_item['page_arguments'])) { $item = menu_get_item('taxonomy/term/' . $term->id() . '/edit'); if ($item['access']) { $data['tabs'][0][] = array( diff --git a/core/modules/aggregator/lib/Drupal/aggregator/ItemFormController.php b/core/modules/aggregator/lib/Drupal/aggregator/ItemFormController.php index 4216979..4d1955b 100644 --- a/core/modules/aggregator/lib/Drupal/aggregator/ItemFormController.php +++ b/core/modules/aggregator/lib/Drupal/aggregator/ItemFormController.php @@ -29,7 +29,7 @@ public function save(array $form, array &$form_state) { public function actions(array $form, array &$form_state) { $actions = parent::actions($form, $form_state); // Do not provide a delete action. - unset($actions['delete']); + $actions['delete']['#access'] = FALSE; return $actions; } diff --git a/core/modules/aggregator/lib/Drupal/aggregator/Plugin/block/block/AggregatorCategoryBlock.php b/core/modules/aggregator/lib/Drupal/aggregator/Plugin/block/block/AggregatorCategoryBlock.php index fdf20bc..ac0b50f 100644 --- a/core/modules/aggregator/lib/Drupal/aggregator/Plugin/block/block/AggregatorCategoryBlock.php +++ b/core/modules/aggregator/lib/Drupal/aggregator/Plugin/block/block/AggregatorCategoryBlock.php @@ -68,10 +68,10 @@ public function build() { $id = $this->getPluginId(); if ($category = taxonomy_term_load($id)) { $result = entity_query('aggregator_item') - ->condition('field_aggregator_categories.target_id', $category->id()) + ->condition('field_aggregator_categories.target_id', $id) ->range(0, $this->configuration['block_count']) ->execute(); - $read_more = theme('more_link', array('url' => 'aggregator/categories/' . $category->id(), 'title' => t("View this category's recent news."))); + $read_more = theme('more_link', array('url' => 'aggregator/categories/' . $id, 'title' => t("View this category's recent news."))); $items = $result ? entity_load_multiple('aggregator_item', $result) : array(); foreach ($result as $item) {