User tests: Successful: Unsuccessful:
Replaces the state holder for model with a transition class which extends the Registry. Like that we benefit from the features of the Registry which is used across the whole core. It removes the dependency for the deprecated CMSObject
class.
No article is shown.
No article is shown.
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
Category | ⇒ | Libraries Unit Tests |
Status | New | ⇒ | Pending |
Title |
|
Labels |
Added:
?
PR-5.0-dev
|
Category | Libraries Unit Tests | ⇒ | External Library Composer Change Libraries Unit Tests |
Labels |
Added:
Composer Dependency Changed
?
|
Category | Libraries Unit Tests External Library Composer Change | ⇒ | Libraries Unit Tests |
Labels |
Removed:
Composer Dependency Changed
|
I guess the tests are failing because there is actually an issue there:
https://ci.joomla.org/artifacts/joomla/joomla-cms/5.0-dev/39663/system-tests/64369/screenshots/site/
Yes I thought the same I just wanted to be sure ;-) can you have a look?
It is actually a break when we switch to the registry. Because the registry returns the default value when the value in the internal data store is an empty string:
https://github.com/joomla-framework/registry/blob/2.0-dev/src/Registry.php#L207
While the CMSObject checks only if the property exists:
Ok can we make this b/c and trigger a deprecation warning before we are switching to registry?
https://github.com/joomla-framework/registry/blob/2.0-dev/src/Registry.php#L207 looks completely wrong...
Why in the word do we return the default value if value is an empty string? or NULL
we have a remove()
function, shouldn't we only check for isset()
?
https://github.com/joomla-framework/registry/blob/2.0-dev/src/Registry.php#L607
I guess the issue is that this applies only when the separator is empty, otherwise it uses isset further down. If I read the code correctly.
Hmm, your work around works different because 0
empty too... can you point me to the code that had failed in the tests and why?
Here is direction set to an empty string https://github.com/joomla/joomla-cms/blob/5.0-dev/components/com_content/src/Model/FeaturedModel.php#L108 and here it gets the default value https://github.com/joomla/joomla-cms/blob/5.0-dev/components/com_content/src/Model/ArticlesModel.php#L634
The home site will imediately crash when you remove the fix, so you can debug it quickly as it will make then an ordering like a.ordering DESC ASC in the query.
ok then I think we need to keep the workaround and add documentation (and fix the cms) to use $state->remove()
or is there anything that speaks against this?
Why in the word do we return the default value if value is an empty string? or NULL
As I understood, this is made for Form Fields default values, because Registry heavily used in Params, and form validation, filtering etc.
Kind of.
As I understood, this is made for Form Fields default values, because Registry heavily used in Params, and form validation, filtering etc. Kind of.
ok sounds wrong anyway
Where do you want to document what?
Where do you want to document what?
good question, one point would be the deprecation b/c part for joomla upgrades. On the other side we should mention this in the documentation of the model in the wiki? and the manual (doesn't exist yet?)
Labels |
Added:
Feature
b/c break
Removal
|
Status | Pending | ⇒ | Fixed in Code Base |
Closed_Date | 0000-00-00 00:00:00 | ⇒ | 2023-05-29 14:20:58 |
Closed_By | ⇒ | HLeithner |
I merge this for now so we may get hopefully real world feedback in alpha 1.
@HLeithner what do we do here?