From cc22ae663a5aafe1872549be1793d775356ae0ee Mon Sep 17 00:00:00 2001
From: Angie Byron <webchick@24967.no-reply.drupal.org>
Date: Fri, 21 Aug 2009 00:50:32 +0000
Subject: [PATCH] #541708 by catch: Removed unnecessary query in
 _filter_tips().

---
 modules/filter/filter.module | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/modules/filter/filter.module b/modules/filter/filter.module
index 66fd6a5f7c0f..9efe7999145e 100644
--- a/modules/filter/filter.module
+++ b/modules/filter/filter.module
@@ -551,15 +551,15 @@ function filter_access($format) {
  * Helper function for fetching filter tips.
  */
 function _filter_tips($format, $long = FALSE) {
-  if ($format == -1) {
-    $formats = filter_formats();
-  }
-  else {
-    $formats = array(db_query("SELECT * FROM {filter_format} WHERE format = :format", array(':format' => $format))->fetchObject());
-  }
+  $formats = filter_formats();
 
   $tips = array();
 
+  // If only listing one format, extract it from the $formats array.
+  if ($format != -1) {
+    $formats = array($formats[$format]);
+  }
+
   foreach ($formats as $format) {
     $filters = filter_list_format($format->format);
 
-- 
GitLab