Skip to content
Snippets Groups Projects
Commit a8d2c8e8 authored by Dries Buytaert's avatar Dries Buytaert
Browse files

- Path Patch #1213242 by andypost: optimize count(has) quiery.

parent 1866b96e
No related branches found
No related tags found
2 merge requests!7452Issue #1797438. HTML5 validation is preventing form submit and not fully...,!789Issue #3210310: Adjust Database API to remove deprecated Drupal 9 code in Drupal 10
...@@ -283,7 +283,7 @@ function _aggregator_category_title($category) { ...@@ -283,7 +283,7 @@ function _aggregator_category_title($category) {
* otherwise. * otherwise.
*/ */
function _aggregator_has_categories() { function _aggregator_has_categories() {
return user_access('access news feeds') && db_query('SELECT COUNT(*) FROM {aggregator_category}')->fetchField(); return user_access('access news feeds') && (bool) db_query_range('SELECT 1 FROM {aggregator_category}', 0, 1)->fetchField();
} }
/** /**
......
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