Skip to content

Commit

Permalink
Reverting [#30430] Severe bug with "com_content" component routing.
Browse files Browse the repository at this point in the history
  • Loading branch information
dextercowley committed Apr 4, 2013
1 parent 2c77c35 commit 5c51f56
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 27 deletions.
1 change: 0 additions & 1 deletion components/com_content/helpers/route.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ public static function getArticleRoute($id, $catid = 0, $language = 0)
);
//Create the link
$link = 'index.php?option=com_content&view=article&id='. $id;

if ((int) $catid > 1)
{
$categories = JCategories::getInstance('Content');
Expand Down
7 changes: 2 additions & 5 deletions components/com_content/router.php
Original file line number Diff line number Diff line change
Expand Up @@ -326,11 +326,8 @@ function ContentParseRoute($segments)
}
else
{
if ($cat_id > 0)
{
$vars['view'] = 'category';
$vars['id'] = $cat_id;
}
$vars['view'] = 'category';
$vars['id'] = $cat_id;
}

return $vars;
Expand Down
3 changes: 3 additions & 0 deletions installation/CHANGELOG
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,9 @@ $ -> Language fix or change
- -> Removed
! -> Note3

04-Apr-2013 Mark Dexter
# Reverting [#30430] Severe bug with "com_content" component routing.

04-Apr-2013 Jean-Marie Simonet
# [#30454] Tags: Adding Tags via Batch function replaces all previous tags. Thanks David and Elin.
# [#30463] Missing closing div in compact tag layout. Thanks Thomas Hunziker and Constantin Romankiewicz
Expand Down
14 changes: 5 additions & 9 deletions libraries/cms/router/site.php
Original file line number Diff line number Diff line change
Expand Up @@ -242,15 +242,13 @@ protected function _parseSefRoute($uri)
// Set the active menu item
$menu->setActive($vars['Itemid']);
}

return $vars;
}

/*
* Parse the application route
*/
$segments = explode('/', $route);

if (count($segments) > 1 && $segments[0] == 'component')
{
$vars['option'] = 'com_' . $segments[1];
Expand All @@ -277,7 +275,7 @@ protected function _parseSefRoute($uri)
// Get the length of the route
$length = strlen($item->route);
if ($length > 0 && JString::strpos($route_lowercase . '/', $item->route . '/') === 0
&& $item->type != 'menulink' && (!JLanguageMultilang::isEnabled() || $item->language == '*'
&& $item->type != 'menulink' && (!$app->getLanguageFilter() || $item->language == '*'
|| $item->language == $lang_tag))
{
// We have exact item for this language
Expand All @@ -296,7 +294,7 @@ protected function _parseSefRoute($uri)

if (!$found)
{
return false;
$found = $menu->getDefault($lang_tag);
}
else
{
Expand All @@ -306,11 +304,9 @@ protected function _parseSefRoute($uri)
$route = substr($route, 1);
}
}
if (isset($found->id) && $found->id)
{
$vars['Itemid'] = $found->id;
$vars['option'] = $found->component;
}

$vars['Itemid'] = $found->id;
$vars['option'] = $found->component;
}

// Set the active menu item
Expand Down
15 changes: 3 additions & 12 deletions libraries/joomla/application/router.php
Original file line number Diff line number Diff line change
Expand Up @@ -180,19 +180,10 @@ public function parse($uri)
// Parse SEF URL
if ($this->_mode == JROUTER_MODE_SEF)
{
$routevars = $this->_parseSefRoute($uri);

if (($routevars === false))
{
return array();
}
else
{
$vars += $routevars;

return array_merge($this->getVars(), $vars);
}
$vars += $this->_parseSefRoute($uri);
}

return array_merge($this->getVars(), $vars);
}

/**
Expand Down

0 comments on commit 5c51f56

Please sign in to comment.