Try this code anywhere you can
use Joomla\CMS\Factory;
$app = Factory::getApplication();
$model = $app->bootComponent('com_content')
->getMVCFactory()
->createModel('Category', 'Site', ['ignore_request' => false]); // we try to get exists model in
$category = $model->getCategory();
And we have an error: Call to a member function get() on null /components/com_content/src/Model/CategoryModel.php:338
If you'll add a line
$model->getState('category.id');
and then $category = $model->getCategory(); - there are no any errors.
Joomla 5.4. With Joomla 5.3 there were no such errors.
| Labels |
Added:
No Code Attached Yet
|
||
| Labels |
Added:
bug
|
||
| Status | New | ⇒ | Closed |
| Closed_Date | 0000-00-00 00:00:00 | ⇒ | 2025-10-18 06:56:24 |
| Closed_By | ⇒ | alikon |
Sorry for the inconvenience caused by my PR
@heelc29 No need for sorry, zero mistakes happen only to those who do zero work. And you are doing good work.
When I mentioned your PR it was not to blame someone, it was to find out what the cause of the issue could be, with the hope you can help, what you did, and so we have to say thank you.
@heelc29 Could that come from PR #45704 ?