diff --git a/libraries/cms/component/helper.php b/libraries/cms/component/helper.php index feda9f6b2180f..f71717416c7dc 100644 --- a/libraries/cms/component/helper.php +++ b/libraries/cms/component/helper.php @@ -56,6 +56,13 @@ public static function getComponent($option, $strict = false) $result = static::$components[$option]; } + if (is_string($result->params)) + { + $temp = new Registry; + $temp->loadString(static::$components[$option]->params); + static::$components[$option]->params = $temp; + } + return $result; } @@ -406,15 +413,14 @@ protected static function load($option) $query = $db->getQuery(true) ->select('extension_id AS id, element AS "option", params, enabled') ->from('#__extensions') - ->where($db->quoteName('type') . ' = ' . $db->quote('component')) - ->where($db->quoteName('element') . ' = ' . $db->quote($option)); + ->where($db->quoteName('type') . ' = ' . $db->quote('component')); $db->setQuery($query); $cache = JFactory::getCache('_system', 'callback'); try { - static::$components[$option] = $cache->get(array($db, 'loadObject'), null, $option, false); + static::$components = $cache->get(array($db, 'loadObjectList'), array('option'), $option, false); } catch (RuntimeException $e) { @@ -433,14 +439,6 @@ protected static function load($option) return false; } - // Convert the params to an object. - if (is_string(static::$components[$option]->params)) - { - $temp = new Registry; - $temp->loadString(static::$components[$option]->params); - static::$components[$option]->params = $temp; - } - return true; } }