Skip to content

Commit

Permalink
Applied coding standards to #25663.
Browse files Browse the repository at this point in the history
  • Loading branch information
pjwiseman committed Sep 30, 2012
1 parent cdbc3a3 commit 486b4bb
Showing 1 changed file with 11 additions and 7 deletions.
18 changes: 11 additions & 7 deletions libraries/joomla/installer/adapters/component.php
Expand Up @@ -1271,32 +1271,36 @@ protected function _buildAdminMenus()
$query = $db->getQuery(true);
$query->select('id');
$query->from('#__menu');
$query->where('menutype = '.$db->quote('main'));
$query->where('menutype = ' . $db->quote('main'));
$query->where('client_id = 1');
$query->where('link = '.$db->quote('index.php?option='.$option));
$query->where('type = '.$db->quote('component'));
$query->where('link = ' . $db->quote('index.php?option=' . $option));
$query->where('type = ' . $db->quote('component'));
$query->where('parent_id = 1');
$query->where('home = 0');

$db->setQuery($query);
$menu_id = $db->loadResult();

if(!$menu_id) {
if (!$menu_id)
{
// Oops! Could not get the menu ID. Go back and rollback changes.
JError::raiseWarning(1, $table->getError());
return false;
} else {
}
else
{
// Remove the old menu item
$query = $db->getQuery(true);
$query->delete('#__menu');
$query->where('id = '.(int)$menu_id);
$query->where('id = ' . (int) $menu_id);

$db->setQuery($query);
$db->query();

// Retry creating the menu item
$table->setLocation(1, 'last-child');
if (!$table->bind($data) || !$table->check() || !$table->store()) {
if (!$table->bind($data) || !$table->check() || !$table->store())
{
// Install failed, warn user and rollback changes
JError::raiseWarning(1, $table->getError());
return false;
Expand Down

0 comments on commit 486b4bb

Please sign in to comment.