? PR-5.0-dev Pending

User tests: Successful: Unsuccessful:

avatar laoneo
laoneo
22 Oct 2022

Summary of Changes

Replaces the state holder for model with an array based class. It removes the dependency for the deprecated CMSObject class.

Like that he performance can be improved by a third against using the CMSObject class.

Testing Instructions

  • Create an article in the back end with the state published
  • Filter for trashed articles

Actual result BEFORE applying this Pull Request

No article is shown.

Expected result AFTER applying this Pull Request

No article is shown.

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: joomla/Manual#78 and joomla/Manual#77

  • No documentation changes for manual.joomla.org needed

avatar laoneo laoneo - open - 22 Oct 2022
avatar laoneo laoneo - change - 22 Oct 2022
Status New Pending
avatar laoneo laoneo - change - 22 Oct 2022
Title
[5.0 Replaces the dependency for model state with a State object
[5.0] Replaces the dependency for model state with a State object
avatar laoneo laoneo - edited - 22 Oct 2022
avatar joomla-cms-bot joomla-cms-bot - change - 22 Oct 2022
Category Libraries
avatar laoneo laoneo - change - 22 Oct 2022
Labels Added: PR-5.0-dev
avatar Abernyte-Git
Abernyte-Git - comment - 22 Oct 2022

I have tested this item successfully on a9aa13d


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

avatar Abernyte-Git Abernyte-Git - test_item - 22 Oct 2022 - Tested successfully
avatar wilsonge
wilsonge - comment - 27 Oct 2022

Is there a reason not to use Registry? Given it has similar methods as JObject for b/c purposes but also implements arrayAccess as an interface which could be situationally useful

avatar laoneo
laoneo - comment - 28 Oct 2022

I tried to use registry but it doesn't support field access. So it would be a hard BC break. It is also massive slower than CMSObject or this new State class.

189195b 16 Jan 2023 avatar laoneo tests
avatar joomla-cms-bot joomla-cms-bot - change - 16 Jan 2023
Category Libraries Libraries Unit Tests
avatar laoneo laoneo - change - 18 Jan 2023
The description was changed
avatar laoneo laoneo - edited - 18 Jan 2023
2d06614 18 Jan 2023 avatar laoneo type
avatar laoneo laoneo - change - 18 Jan 2023
Labels Added: ?
avatar Fedik
Fedik - comment - 18 Jan 2023

Registry have some benefits also. In future you probably will be need serialisation, cloning.
Can try extend ModelState from Registry, and implement magick get/set.

Performance issue can overcome by disabling $separator, and make it always "flattened".
But that probably require changes in Registry class itself.
Much more work.
Hm, seems a simple State that you made here also fine :)

avatar laoneo
laoneo - comment - 18 Jan 2023

But then I would rather extend the registry class with the magic methods and not introduce a new class at all.

avatar laoneo laoneo - change - 18 Jan 2023
The description was changed
avatar laoneo laoneo - edited - 18 Jan 2023
avatar HLeithner
HLeithner - comment - 18 Jan 2023

But then I would rather extend the registry class with the magic methods and not introduce a new class at all.

This would be against the argumentation in joomla-framework/registry#58

avatar laoneo
laoneo - comment - 18 Jan 2023

I made an alternative which is using the registry in #39663.

avatar laoneo
laoneo - comment - 23 Feb 2023

Closing in favor of #39663. When joomla-framework/registry#66 got merged, then we have the same speed without a new class which does more or less the same as the registry.

avatar laoneo laoneo - change - 23 Feb 2023
Status Pending Closed
Closed_Date 0000-00-00 00:00:00 2023-02-23 13:00:56
Closed_By laoneo
avatar laoneo laoneo - close - 23 Feb 2023

Add a Comment

Login with GitHub to post a comment