When a component tries to access its own parameters with
$params = JComponentHelper::getParams('com_mycomponent');
within the postflight()
method of its own installation script
public function postflight($type, $parent)
{
$params = JComponentHelper::getParams('com_mycomponent');
}
then the following happens:
if the system cache is enabled (either Conservative or Progressive) a warning is raised
Error loading component: com_mycomponent, Component not found.
if the system cache is disabled instead, then the component can access its parameters without problems.
Needless to say, at the time postflight() method is called, the component is installed, and the parameters are available in the database. Replacing the call to JComponentHelper::getParams() with a custom SQL query gets the parameters correctly.
$table = JTable::getInstance('extension');
$table->load(array('element' => 'com_mycomponent', 'client_id' => 1));
// Now $table->params contains the data
This problem affects Joomla 3.7 and newer versions, while the 3.6 series and older worked properly.
I'm pretty sure that this is just another of the problems caused by the well known cache refactoring released with Joomla 3.7.0, and for which a patch is already available at #15875
JComponentHelper::load() does not return the component's parameters
See the line
static::$components = $cache->get($loader, array(), __METHOD__);
Labels |
Added:
?
|
I suspect this. I can test to be sure.
Category | ⇒ | com_plugins Installation |
Status | New | ⇒ | Information Required |
Status | Information Required | ⇒ | Closed |
Closed_Date | 0000-00-00 00:00:00 | ⇒ | 2017-09-27 23:12:47 |
Closed_By | ⇒ | brianteeman |
so can you confirm then that \15875 fixes this? if so then there is no need for a new issue and this can be closed