No Code Attached Yet bug
avatar sergeytolkachyov
sergeytolkachyov
17 Oct 2025

Steps to reproduce the issue

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

Image

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.

avatar sergeytolkachyov sergeytolkachyov - open - 17 Oct 2025
avatar joomla-cms-bot joomla-cms-bot - change - 17 Oct 2025
Labels Added: No Code Attached Yet
avatar joomla-cms-bot joomla-cms-bot - labeled - 17 Oct 2025
avatar richard67
richard67 - comment - 17 Oct 2025

@heelc29 Could that come from PR #45704 ?

avatar richard67 richard67 - change - 17 Oct 2025
Labels Added: bug
avatar richard67 richard67 - labeled - 17 Oct 2025
avatar heelc29
heelc29 - comment - 17 Oct 2025

@heelc29 Could that come from PR #45704 ?

Yes, I think you are right.

avatar heelc29
heelc29 - comment - 18 Oct 2025

Please test #46316

Sorry for the inconvenience caused by my PR

avatar alikon alikon - change - 18 Oct 2025
Status New Closed
Closed_Date 0000-00-00 00:00:00 2025-10-18 06:56:24
Closed_By alikon
avatar alikon alikon - close - 18 Oct 2025
avatar alikon
alikon - comment - 18 Oct 2025

closing as we have a pr #46316 to test

avatar richard67
richard67 - comment - 18 Oct 2025

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.

Add a Comment

Login with GitHub to post a comment