Make CLI app which create instance of ArticleModel: $article = \Joomla\CMS\Factory::getApplication()->bootComponent('com_content')->getMVCFactory()->createModel('Article', 'Administrator');
I get model object
[TypeError]
Joomla\CMS\Workflow\Workflow::__construct(): Argument #2 ($app) must be of type ?Joomla\CMS\Application\CMSApplication, Joomla\CMS\Application\ConsoleApplication given, called in ....../libraries/src/MVC/Model/WorkflowBehaviorTrait.php on line 90
Problem is in \Joomla\CMS\Workflow\Workflow::__construct
. Method is:
public function __construct(string $extension, ?CMSApplication $app = null, ?DatabaseDriver $db = null)
should be
public function __construct(string $extension, ?CMSApplicationInterface $app = null, ?DatabaseDriver $db = null)
because \Joomla\CMS\Application\CliApplication implements CMSApplicationInterface, not extends CMSApplication.
Labels |
Added:
No Code Attached Yet
|
Status | New | ⇒ | Closed |
Closed_Date | 0000-00-00 00:00:00 | ⇒ | 2024-11-02 09:47:23 |
Closed_By | ⇒ | alikon |
thanks for reporting follow #40653