Permalink
Browse files

Reverting [#30430] Severe bug with "com_content" component routing.

  • Loading branch information...
1 parent 2c77c35 commit 5c51f568d70e386370abc7841cd832754661d913 @dextercowley dextercowley committed Apr 4, 2013
@@ -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');
@@ -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;
@@ -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
@@ -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];
@@ -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
@@ -296,7 +294,7 @@ protected function _parseSefRoute($uri)
if (!$found)
{
- return false;
+ $found = $menu->getDefault($lang_tag);
}
else
{
@@ -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
@@ -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);
}
/**

0 comments on commit 5c51f56

Please sign in to comment.