[5.4] check if state is initialized in content CategoryModel#46316
Merged
richard67 merged 2 commits intojoomla:5.4-devfrom Oct 19, 2025
Merged
[5.4] check if state is initialized in content CategoryModel#46316richard67 merged 2 commits intojoomla:5.4-devfrom
richard67 merged 2 commits intojoomla:5.4-devfrom
Conversation
Contributor
|
Both codes work, so I give a successful test. I would keep the old-fashioned variant, it is easier to read. This model will be often read by extension developers who are not familiar with newest PHP syntax. If the new variant is used, a comment could be helpful. |
Contributor
|
I have tested this item ✅ successfully on 8c8290d This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/46316. |
Contributor
|
I have tested this item ✅ successfully on b8a1198 This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/46316. |
Contributor
|
RTC This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/46316. |
Member
|
Thanks @heelc29 for the fix, and @chmst and @joomdonation for testing. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Pull Request for Issue #46311 .
Summary of Changes
Check if model state is initialized before access
This is regression from PR #45704
Testing Instructions
Follow issue description or add following code to
components\com_content\tmpl\featured\default.phpActual result BEFORE applying this Pull Request
Exception

Expected result AFTER applying this Pull Request
Should work again (like J5.3)

Link to documentations
Please select: