User tests: Successful: Unsuccessful:
Pull Request for Issue #30107 .
Makes Table\User:store($updateNulls = false) instead of true by default.
This makes it OO-definitions compatible with its parent-classes Table and TableInterface definitions.
Edit, update and save user in front-end and admin area, keeping password unchanged, and changing password, it should work fine as before.
Works fine in Joomla. (But breaks CB for Joomla 4.0 dev version)
Works fine in Joomla.
None.
Status | New | ⇒ | Pending |
Category | ⇒ | Libraries |
Changing this makes nullable fields not nullable after the value has been set.
That can still be done by calling $user->store(true), as before.
The B/C break, and the PHP-OO break (forward compatibility to PHP 8+) that this fixes would not been addressed without this proposed fix.
The B/C break, and the PHP-OO break (forward compatibility to PHP 8+) that this fixes would not been addressed without this proposed fix.
Undoes a change from #26611
Also, I'm not sure how this is a "PHP-OO break". PHP allows you to change the default value of an optional parameter, it does not enforce optional parameters having the same value as an interface declaration. See https://3v4l.org/vg1Y3 which has run on PHP 7.2.0 through 8.0.0-alpha2. So if you're trying to claim that there is a PHP 8 incompatibility in this case, then that does not exist.
Considering the database schema in core has changed to support null values, the PHP API needs to be similarly adjusted to support these schema updates. In a multi-version compatible extension, you're probably going to need version conditionals to account for the schema changes and the default value of this method's lone parameter is probably correctly changed as a result of the database schema changes.
why is this a B/C break when in a major release ?
what i'm missing from SEMVER
I'm afraid that reverting this parameter to false could cause unpredictable effects at this Beta 3 stage. Probably it would be better to adapt extensions to the new behavior.
why is this a B/C break when in a major release ?
Hi @alikon , Because there is no depreciation notice.
Hi @mbabker , Thanks for the detailed reply and reference to the PR #26611, better understanding the reasoning behind the breaking change now. Yes, I am already adding many version conditionals, for most of them, I'm not signaling them, as they were, kudos to Joomla devs
But I now do better understand the reasons for this change, and am hesitating if it's a good change or not, as it's inconsistent with all/most other database usages, and inconsistent with its Interface specification (even though PHP allows it up to now, and looks like in 8.0-alpha too, it's probably not best OOP practice). At very least, the TableInterface @param
description should imho be updated that updateNulls is not by default=false
for all TableInterface classes (with a @since 4.0
remark).
I have tested this item
It is working from frontend and backend
I have tested this item
Working as expected
Status | Pending | ⇒ | Discussion |
Setting "Discussion" status since there are reasons against merging this pull request, see the above comments.
I have implemented a workaround by checking Joomla version in CB, so the multi-joomla-versions version of CB in preparation is running fine on both Joomla 3 and 4. So this is not a J4 show-stopper as far as I am concerned. It was more a B/C issue. But I guess very few extensions use that method, so not a big B/C issue either.
The minimum, cool thing, would be to at least document the incompatibility in J4 and depracation in J3. And maybe to update the TableInterface $updateNull parameter description ? (or even default value?)
So as far as I am concerned, we can close this PR, or use it for non-release-blocking discussion.
The minimum, cool thing, would be to at least document the incompatibility in J4 and depracation in J3.
@beat The zero date deprecation is mentioned in section "Updated System Requirements", sub-section "PHP MySQL Extension" here: https://docs.joomla.org/Potential_backward_compatibility_issues_in_Joomla_4 .
In section "About The Database Changes of https://docs.joomla.org/Version_4.0_Beta_FAQ , you find more detailed information about the change from zero dates to null dates.
I'm closing this one here with respect to all previous comments.
Status | Discussion | ⇒ | Closed |
Closed_Date | 0000-00-00 00:00:00 | ⇒ | 2021-05-12 13:03:14 |
Closed_By | ⇒ | richard67 | |
Labels |
Added:
Information Required
|
Changing this makes nullable fields not nullable after the value has been set.