?
avatar diddipoeler
diddipoeler
26 Nov 2017

i develope a component and create a installation file named script.php.

this are the first lines of the file:
class com_sportsmanagementInstallerScript
{

/**
 * Constructor
 *
 * @param   JAdapterInstance  $adapter  The object responsible for running this script
 */    
public function __construct(JAdapterInstance $adapter)
{
$this->release = $adapter->get( "manifest" )->version;
}

if i install the component, i got this error:
An error has occurred.
0 Argument 1 passed to com_sportsmanagementInstallerScript::__construct() must be an instance of JAdapterInstance, instance of Joomla\CMS\Installer\Adapter\ComponentAdapter given, called in /www/htdocs/w0086dfc/joomla40/libraries/src/CMS/Installer/InstallerAdapter.php on line 1006

what am i doing wrong ?

avatar diddipoeler diddipoeler - open - 26 Nov 2017
avatar joomla-cms-bot joomla-cms-bot - change - 26 Nov 2017
Labels Added: ?
avatar joomla-cms-bot joomla-cms-bot - labeled - 26 Nov 2017
avatar franz-wohlkoenig franz-wohlkoenig - change - 26 Nov 2017
Category Installation
avatar franz-wohlkoenig franz-wohlkoenig - change - 26 Nov 2017
Title
[4.0][com_installer] An error has occurred
[4.0] [com_installer] An error has occurred
avatar joomla-cms-bot joomla-cms-bot - edited - 26 Nov 2017
avatar mbabker
mbabker - comment - 26 Nov 2017

Extension adapters no longer extend from JAdapterInstance in 4.0 as noted at https://api.joomla.org/cms-3/classes/Joomla.CMS.Installer.InstallerAdapter.html

You should typehint JInstallerAdapter (for support from 3.4 to present) or Joomla\CMS\Installer\InstallerAdapter (for support from 3.8 to present).

avatar mbabker mbabker - change - 26 Nov 2017
Status New Closed
Closed_Date 0000-00-00 00:00:00 2017-11-26 15:33:23
Closed_By mbabker
avatar mbabker mbabker - close - 26 Nov 2017

Add a Comment

Login with GitHub to post a comment