Upgraded from v8.1 to v8.2, now getting __construct errors in addons
Permalink
All,
A mystery for you. Since upgrading from v8.1 to v8.2, many of my custom addons are now getting errors. Here is one example from the logs:
Exception Occurred: /opt/library/concrete/src/Permission/IPService.php:84 Argument 1 passed to Concrete\Core\Permission\IPService::__construct() must be an instance of Concrete\Core\Config\Repository\Repository, null given, called in /opt/library/packages/adminforms/controllers/dialog/adminforms.php on line 114 and defined (4096)
The offending line is:
$ip = new IPService();
Here is the constructor for IPService:
public function __construct(Repository $config, Connection $connection, Request $request)
{
$this->config = $config;
$this->connection = $connection;
$this->request = $request;
}
Again, this is only one example for this occurance where teh constructor blows up in 8.2 (but not 8.1)
Any thoughts?
A mystery for you. Since upgrading from v8.1 to v8.2, many of my custom addons are now getting errors. Here is one example from the logs:
Exception Occurred: /opt/library/concrete/src/Permission/IPService.php:84 Argument 1 passed to Concrete\Core\Permission\IPService::__construct() must be an instance of Concrete\Core\Config\Repository\Repository, null given, called in /opt/library/packages/adminforms/controllers/dialog/adminforms.php on line 114 and defined (4096)
The offending line is:
$ip = new IPService();
Here is the constructor for IPService:
public function __construct(Repository $config, Connection $connection, Request $request)
{
$this->config = $config;
$this->connection = $connection;
$this->request = $request;
}
Again, this is only one example for this occurance where teh constructor blows up in 8.2 (but not 8.1)
Any thoughts?
So another update: it looks like I can fix this issue by defining a constructor in my override class. Set it for no variables. Problem solved.
Still doesn't explain what triggered this issue (or why it would without a constructor class in the override class previously). But my issue is solved for now.
Still doesn't explain what triggered this issue (or why it would without a constructor class in the override class previously). But my issue is solved for now.
$ip = new IPService();
$mh = new MailHelper();
Yet there is no changes to the file in the latter case. Also, it looks like these should have never worked (yet I know at least the latter did, as we've used the mail helper repeatedly before the update).