?
avatar joeforjoomla
joeforjoomla
16 Oct 2017

Steps to reproduce the issue

Install an extension running on J 3.8 that extends JControllerLegacy and override the constructor __construct

Expected result

All works fine

Actual result

Fatal error: Call to a member function createModel() on null in E:\vhosts\joomla39\libraries\src\MVC\Controller\BaseController.php on line 559

System information (as much as possible)

With the current MVC backported from J4.0 now a class that extends JControllerLegacy AKA Joomla\CMS\MVC\Controller\BaseController throws a fatal error if there is an override for the constructor and the property 'factory' is so empty

Additional comments

Check the existance of the factory object before calling:
$this->factory->createModel
$this->factory->createView

avatar joeforjoomla joeforjoomla - open - 16 Oct 2017
avatar joomla-cms-bot joomla-cms-bot - change - 16 Oct 2017
Labels Added: ?
avatar joomla-cms-bot joomla-cms-bot - labeled - 16 Oct 2017
avatar joeforjoomla joeforjoomla - change - 16 Oct 2017
Title
[3.9] Check MVC Factory existance to avoid B/C
[3.9] Check MVC Factory existance to avoid B/C Fatal Error
avatar joeforjoomla joeforjoomla - edited - 16 Oct 2017
avatar franz-wohlkoenig franz-wohlkoenig - change - 16 Oct 2017
Category Code style
avatar joeforjoomla
joeforjoomla - comment - 16 Oct 2017

Reference PR #18351

avatar franz-wohlkoenig franz-wohlkoenig - change - 16 Oct 2017
Status New Closed
Closed_Date 0000-00-00 00:00:00 2017-10-16 11:46:15
Closed_By franz-wohlkoenig
avatar joomla-cms-bot joomla-cms-bot - change - 16 Oct 2017
Closed_By franz-wohlkoenig joomla-cms-bot
avatar joomla-cms-bot joomla-cms-bot - close - 16 Oct 2017
avatar joomla-cms-bot
joomla-cms-bot - comment - 16 Oct 2017
avatar franz-wohlkoenig
franz-wohlkoenig - comment - 16 Oct 2017

closed as having Pull Request #18351

Add a Comment

Login with GitHub to post a comment