? PHP 8.x ? Pending

User tests: Successful: Unsuccessful:

avatar laoneo
laoneo
11 Jan 2023

Summary of Changes

Adds the AllowDynamicProperties attribute to the core classes Table, MenuItem and CMSObject to 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 in

Expected 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

avatar joomla-cms-bot joomla-cms-bot - change - 11 Jan 2023
Category Libraries
avatar laoneo laoneo - open - 11 Jan 2023
avatar laoneo laoneo - change - 11 Jan 2023
Status New Pending
avatar laoneo laoneo - change - 11 Jan 2023
Labels Added: PHP 8.x ?
avatar laoneo laoneo - change - 11 Jan 2023
Title
Allow dynamic properties for Table, MenuItem and CMSObject
[4.2] PHP8.2 Allow dynamic properties for Table, MenuItem and CMSObject
avatar laoneo laoneo - edited - 11 Jan 2023
avatar Hackwar
Hackwar - comment - 11 Jan 2023

Do we need this for the Table class? Doesn't it inherit that behavior from the CMSObject class?

avatar laoneo
laoneo - comment - 11 Jan 2023

I wanted to make it explicit for better understanding.

avatar wilsonge
wilsonge - comment - 11 Jan 2023

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?

avatar laoneo
laoneo - comment - 11 Jan 2023

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

avatar joomdonation
joomdonation - comment - 11 Jan 2023

I am also unsure about MenuItem class. It does not need AllowDynamicProperties attribute. It should be added to AdministratorMenuItem class instead, at least from what I see in core usages.

avatar joomdonation joomdonation - test_item - 12 Jan 2023 - Tested successfully
avatar joomdonation
joomdonation - comment - 12 Jan 2023

I have tested this item successfully on 1791350

Change my mind. Dynamic properties for MenuItem class are added MenuHelper class of mod_menu frontend.


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/39591.

avatar alikon alikon - test_item - 12 Jan 2023 - Tested successfully
avatar alikon
alikon - comment - 12 Jan 2023

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.

avatar joomdonation
joomdonation - comment - 12 Jan 2023

@SharkyKZ Would be great if you could explain the reason for your thumb down reaction to this PR . Thanks !

avatar laoneo laoneo - change - 12 Jan 2023
Status Pending Ready to Commit
avatar laoneo
laoneo - comment - 12 Jan 2023

RTC


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/39591.

avatar HLeithner HLeithner - change - 12 Jan 2023
Status Ready to Commit Fixed in Code Base
Closed_Date 0000-00-00 00:00:00 2023-01-12 15:34:39
Closed_By HLeithner
Labels Added: ?
avatar HLeithner HLeithner - close - 12 Jan 2023
avatar HLeithner HLeithner - merge - 12 Jan 2023
avatar HLeithner
HLeithner - comment - 12 Jan 2023

At some point we should get rid of all dynamic properties but for now I think being explicit makes it better to identify problems

avatar HLeithner
HLeithner - comment - 12 Jan 2023

thanks

Add a Comment

Login with GitHub to post a comment