?
avatar demis-palma
demis-palma
22 Aug 2017

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.
    image

  • 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

Technical info:

JComponentHelper::load() does not return the component's parameters
See the line
static::$components = $cache->get($loader, array(), __METHOD__);

avatar demis-palma demis-palma - open - 22 Aug 2017
avatar joomla-cms-bot joomla-cms-bot - change - 22 Aug 2017
Labels Added: ?
avatar joomla-cms-bot joomla-cms-bot - labeled - 22 Aug 2017
avatar brianteeman
brianteeman - comment - 22 Aug 2017

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

avatar demis-palma
demis-palma - comment - 22 Aug 2017

I suspect this. I can test to be sure.

avatar franz-wohlkoenig franz-wohlkoenig - change - 23 Aug 2017
Category com_plugins Installation
avatar franz-wohlkoenig franz-wohlkoenig - change - 23 Aug 2017
Status New Information Required
avatar demis-palma demis-palma - change - 19 Sep 2017
The description was changed
avatar demis-palma demis-palma - edited - 19 Sep 2017
avatar demis-palma demis-palma - change - 19 Sep 2017
The description was changed
avatar demis-palma demis-palma - edited - 19 Sep 2017
avatar brianteeman
brianteeman - comment - 27 Sep 2017

I am closing this as resolved with #15875 i can always be reopened if that is not the case

avatar brianteeman brianteeman - change - 27 Sep 2017
Status Information Required Closed
Closed_Date 0000-00-00 00:00:00 2017-09-27 23:12:47
Closed_By brianteeman
avatar brianteeman brianteeman - close - 27 Sep 2017

Add a Comment

Login with GitHub to post a comment