You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The documentation should clarify whether existing extensions need to be updated to handle both CMSObject and stdClass during the transition period for backward compatibility
- Description: The `AdminModel` class does return a `stdClass` object in the `getItem` function instead of a `CMSObject`. This means that all the deprecated functions of `CMSObject` are not available anymore. Mainly the set and get function should be replaced accordingly as documented in the `CMSObject` class or the respective traits. For example you can use
```php
Qodo Merge was enabled for this repository. To continue using it, please link your Git account with your Qodo account here.
PR Code Suggestions ✨
Explore these optional code suggestions:
Category
Suggestion
Impact
General
Add type safety warning
Add a warning note about potential data type issues when accessing properties of stdClass objects, since they don't enforce type safety like CMSObject did. Developers should implement their own type checking when needed.
#### getItem returns a stdClass instead of CMSObject
- PR: https://github.com/joomla/joomla-cms/pull/42961
- File: libraries/src/MVC/Model/AdminModel.php
-- Description: The `AdminModel` class does return a `stdClass` object in the `getItem` function instead of a `CMSObject`.+- Description: The `AdminModel` class does return a `stdClass` object in the `getItem` function instead of a `CMSObject`. Note that stdClass objects don't enforce property types - developers should implement appropriate type checking when accessing properties if type safety is required.
[To ensure code accuracy, apply this suggestion manually]
Suggestion importance[1-10]: 8
__
Why: The suggestion addresses an important security and reliability concern by warning developers about the loss of type safety when migrating from CMSObject to stdClass. This is crucial information for maintaining code quality and preventing potential runtime errors.
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
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.
User description
Manual entry for pr joomla/joomla-cms#44880.
Followup of #380.
PR Type
Documentation
Description
Documented the removal of
CMSObjectclass usage.Explained transition from
CMSObjecttostdClass.Highlighted affected components and models in Joomla core.
Provided examples for adapting to the changes.
Changes walkthrough 📝
removed-backward-incompatibility.md
Documented removal of `CMSObject` and transition to `stdClass`migrations/54-60/removed-backward-incompatibility.md
CMSObjectremoval.stdClassin core models.CMSObjectfunctions.