summaryrefslogtreecommitdiff
path: root/includes
diff options
context:
space:
mode:
authorDries Buytaert <dries@buytaert.net>2007-08-12 16:12:00 +0000
committerDries Buytaert <dries@buytaert.net>2007-08-12 16:12:00 +0000
commitc17499b6fe5e9b388d09151d2c3525976fde065c (patch)
tree0203a1d7f6cbeba58fc2056ae4f6c6caa30119d0 /includes
parentb134b023e11902ceae12f3ab861da1f0a2fdbdbd (diff)
downloadbrdo-c17499b6fe5e9b388d09151d2c3525976fde065c.tar.gz
brdo-c17499b6fe5e9b388d09151d2c3525976fde065c.tar.bz2
- Patch #163191 by hswong3i: removed db_num_rows() for compatibility with Oracle and DB2. Also a performance improvement. (Correct version this time.)
Diffstat (limited to 'includes')
-rw-r--r--includes/menu.inc4
1 files changed, 3 insertions, 1 deletions
diff --git a/includes/menu.inc b/includes/menu.inc
index 624ee923b..105697465 100644
--- a/includes/menu.inc
+++ b/includes/menu.inc
@@ -720,11 +720,13 @@ function menu_tree_page_data($menu_name = 'navigation') {
// their children to the list as well.
do {
$result = db_query("SELECT mlid FROM {menu_links} WHERE menu_name = '%s' AND expanded = 1 AND has_children = 1 AND plid IN (". $placeholders .') AND mlid NOT IN ('. $placeholders .')', array_merge(array($menu_name), $args, $args));
+ $num_rows = FALSE;
while ($item = db_fetch_array($result)) {
$args[] = $item['mlid'];
+ $num_rows = TRUE;
}
$placeholders = implode(', ', array_fill(0, count($args), '%d'));
- } while ($item);
+ } while ($num_rows);
}
array_unshift($args, $menu_name);
}