User tests: Successful: Unsuccessful:
Remove direct property access of model state
Change API model state also to State|Registery (missed in #39663)
Enable Log Deprecated API
in Global Configuration
Visit different views
Check log file logs/deprecated.php
direct property access of model state
deprecated Direct property access will not be supported in 7.0 in Joomla\CMS\MVC\Model\State::__get::Joomla\CMS\MVC\Model\State. - [ROOT]\libraries\src\MVC\Model\State.php - Line 94
no direct property access of model state
Please select:
Status | New | ⇒ | Pending |
Category | ⇒ | Administration com_banners com_contact com_content com_contenthistory com_finder com_newsfeeds com_tags com_users Front End Libraries |
Labels |
Added:
PR-5.4-dev
|
Title |
|
deprecated Instead of an empty value, the default value will be returned in 7.0 in Joomla\CMS\MVC\Model\State::get::Joomla\CMS\MVC\Model\State. - [ROOT]/libraries/src/MVC/Model/State.php - Line 56
(I am seeing a LOT of those as well)
Is that a side-effect of this PR, or completely irrelevant/unrelated? Sorry, again for the dumb question.
@exlemor No worries at all - it's a valid question! In this case, it's not relevant to this PR, so no need to worry about it here.
But it looks like the code does not match the registry class. It compares against null and an empty string, while the deprecation message uses PHP’s empty() function, which also returns true for 0 (int/float) and empty arrays. @laoneo, should a PR be created?
joomla-cms/libraries/src/MVC/Model/State.php
Lines 53 to 64 in 36516f6
If I 'm not wrong, then made it like that because of bc reasons.
@heelc29 In your testing instructions you wrote:
- open existing banner for editing in backend
- open existing banner for editing in backend
I assume the 2nd one should be "banner client", is that right?
If so, could you update the instructions?
@exlemor Have you tested banner client, too?
Hello @richard67, I had followed instruction and stupid me I assumed it was a mistake (the double line) and I had not but I JUST did a second ago and validate that the message goes away with this PR which I just redownloaded as a Download Package so all good :).
I assume the 2nd one should be "banner client", is that right?
Yes your right
I have tested this item ✅ successfully on 9aa1341
Status | Pending | ⇒ | Ready to Commit |
RTC
administrator/logs/deprecated.php
before this PRJoomla_5.4.0-alpha4-dev+pr.45704-Development-Full_Package.zip
, enabled 'Log Deprecated API', 'Log Almost Everything', 'Gather Search Statistics' and 'User Registration'2025-08-11T05:13:50+00:00 WARNING 192.168.65.1 deprecated Direct property access will not be supported in 7.0 in Joomla\CMS\MVC\Model\State::__get::Joomla\CMS\MVC\Model\State. - [ROOT]/libraries/src/MVC/Model/State.php - Line 94
All are successful, except one:
menu item type 'Archived Articles' (placed in Bottom menu) each frontend site click creates one entry:
2025-08-11T05:13:50+00:00 WARNING 192.168.65.1 deprecated Direct property access will not be supported in 7.0 in Joomla\CMS\MVC\Model\State::__get::Joomla\CMS\MVC\Model\State. - [ROOT]/libraries/src/MVC/Model/State.php - Line 94
- Created [5.4] Deprecation from 'Archived Articles' #45884 to fix this one place and not to test all again
its from #45841
@muhme Should I do a branch update and fix this one?
Status | Ready to Commit | ⇒ | Fixed in Code Base |
Closed_Date | 0000-00-00 00:00:00 | ⇒ | 2025-08-11 10:10:14 |
Closed_By | ⇒ | muhme | |
Labels |
Added:
RTC
|
Thank you @heelc29 for your contribution. Thank you @laoneo for supporting this PR. Thank you @exlemor and @richard67 for testing.
I have tested this item ✅ successfully on cdeadcf
I have successfully tested this PR. Thanks @heelc29 for the hard work.
1 comment/inquiry (I apologize in advance if my inquiry is stupid: while the messages Direct property access will not be supported in 7.0 in Joomla\CMS\MVC\Model\State:: etc are no longer in the deprecated.php log :D, I am noticing one quite similar (I understand it is different) and out of doubt, I prefer mentioning it in case it mattered:
deprecated Instead of an empty value, the default value will be returned in 7.0 in Joomla\CMS\MVC\Model\State::get::Joomla\CMS\MVC\Model\State. - [ROOT]/libraries/src/MVC/Model/State.php - Line 56
(I am seeing a LOT of those as well)
Is that a side-effect of this PR, or completely irrelevant/unrelated? Sorry, again for the dumb question.
This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/45704.