[4.2] PHP8.2 Allow dynamic properties for Table, MenuItem and CMSObject#39591
[4.2] PHP8.2 Allow dynamic properties for Table, MenuItem and CMSObject#39591HLeithner merged 3 commits intojoomla:4.2-devfrom
Conversation
|
Do we need this for the Table class? Doesn't it inherit that behavior from the CMSObject class? |
|
I wanted to make it explicit for better understanding. |
|
Table/CMSObject obviously fine (I mean Hannes is right but I have no problem with it being explicit). In theory MenuItem shouldn't have needed this. Is there a public property missing from the class or something? |
I thought the same till I saw this code https://github.com/joomla/joomla-cms/blob/4.2-dev/libraries/src/Menu/MenuItem.php#L208 |
|
I am also unsure about |
|
I have tested this item ✅ successfully on 1791350 This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/39591. |
|
I have tested this item ✅ successfully on 3412c5f This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/39591. |
|
@SharkyKZ Would be great if you could explain the reason for your thumb down reaction to this PR . Thanks ! |
|
RTC This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/39591. |
|
At some point we should get rid of all dynamic properties but for now I think being explicit makes it better to identify problems |
|
thanks |
Summary of Changes
Adds the
AllowDynamicPropertiesattribute to the core classesTable,MenuItemandCMSObjectto mark them as classes which do use dynamic properties.Testing Instructions
Open the back end with PHP 8.2.
Actual result BEFORE applying this Pull Request
Tons of deprecated warnings like:
Deprecated: Creation of dynamic property ...... is deprecated inExpected result AFTER applying this Pull Request
No warning in the mentioned classes.
Link to documentations
Please select:
Documentation link for docs.joomla.org:
No documentation changes for docs.joomla.org needed
Pull Request link for manual.joomla.org:
No documentation changes for manual.joomla.org needed