Skip to content

Commit

Permalink
fixed issue with a group_id value being a string and selecting the ap…
Browse files Browse the repository at this point in the history
…propriate active menu item
  • Loading branch information
David McReynolds committed Oct 22, 2011
1 parent 834a163 commit 28584e7
Showing 1 changed file with 11 additions and 5 deletions.
16 changes: 11 additions & 5 deletions fuel/modules/fuel/models/navigation_model.php
Expand Up @@ -17,14 +17,20 @@ function __construct()

function find_by_location($location, $group_id = 1)
{
$where = array();
$where[$this->_tables['navigation'].'.location'] = $location;
if (!empty($group_id))
{
$data = $this->find_one_array(array($this->_tables['navigation'].'.location' => $location, 'group_id' => $group_id));
}
else
{
$data = $this->find_all_array(array($this->_tables['navigation'].'.location' => $location));
if (is_string($group_id))
{
$where[$this->_tables['navigation_groups'].'.name'] = $group_id;
}
else
{
$where['group_id'] = (int)$group_id;
}
}
$data = $this->find_one_array($where);
return $data;
}

Expand Down

0 comments on commit 28584e7

Please sign in to comment.