summaryrefslogtreecommitdiff
path: root/includes
diff options
context:
space:
mode:
authorDries Buytaert <dries@buytaert.net>2009-08-11 07:45:45 +0000
committerDries Buytaert <dries@buytaert.net>2009-08-11 07:45:45 +0000
commitdaa26f7982cec0b3101103ef0b89b3c2eded5cfb (patch)
tree3c6c0dde14f5bee175741dd4390d5ec91143ad03 /includes
parente66d0b7519090a6d1bbe6fedd8b275ad5703643f (diff)
downloadbrdo-daa26f7982cec0b3101103ef0b89b3c2eded5cfb.tar.gz
brdo-daa26f7982cec0b3101103ef0b89b3c2eded5cfb.tar.bz2
- Patch #536768 by chx: use the database to do type casting so we can clean up some code. ;-)
Diffstat (limited to 'includes')
-rw-r--r--includes/menu.inc5
1 files changed, 2 insertions, 3 deletions
diff --git a/includes/menu.inc b/includes/menu.inc
index be222026b..3396476aa 100644
--- a/includes/menu.inc
+++ b/includes/menu.inc
@@ -865,7 +865,7 @@ function menu_tree_all_data($menu_name, $item = NULL) {
// If the tree data was not in the cache, $data will be NULL.
if (!isset($data)) {
// Build and run the query, and build the tree.
- $query = db_select('menu_links', 'ml');
+ $query = db_select('menu_links', 'ml', array('fetch' => PDO::FETCH_ASSOC));
$query->leftJoin('menu_router', 'm', 'm.path = ml.router_path');
$query->fields('ml');
$query->fields('m', array(
@@ -1035,7 +1035,7 @@ function menu_tree_page_data($menu_name) {
// Select the links from the table, and recursively build the tree. We
// LEFT JOIN since there is no match in {menu_router} for an external
// link.
- $query = db_select('menu_links', 'ml');
+ $query = db_select('menu_links', 'ml', array('fetch' => PDO::FETCH_ASSOC));
$query->leftJoin('menu_router', 'm', 'm.path = ml.router_path');
$query->fields('ml');
$query->fields('m', array(
@@ -1188,7 +1188,6 @@ function _menu_tree_data($result, $parents, $depth, $previous_element = '') {
$remnant = NULL;
$tree = array();
foreach ($result as $item) {
- $item = is_object($item) ? get_object_vars($item) : $item;
// We need to determine if we're on the path to root so we can later build
// the correct active trail and breadcrumb.
$item['in_active_trail'] = in_array($item['mlid'], $parents);