-
-
Notifications
You must be signed in to change notification settings - Fork 3.7k
[4.0] [com_checkin] Use NULL for checked_out_time columns when checking in items #26490
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
wilsonge
merged 8 commits into
joomla:4.0-dev
from
richard67:4.0-dev-datetime-default-com-checkin
Oct 19, 2019
Merged
[4.0] [com_checkin] Use NULL for checked_out_time columns when checking in items #26490
wilsonge
merged 8 commits into
joomla:4.0-dev
from
richard67:4.0-dev-datetime-default-com-checkin
Oct 19, 2019
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This was referenced Oct 12, 2019
Member
Author
|
@wilsonge This one here does not depend on any other PR now because only users is left with datetime stuff, and users don't have a checked out time ;-) |
Member
Author
|
Please wait until I've reported back there that I have tested it myself. |
wilsonge
approved these changes
Oct 17, 2019
Member
Author
|
@roland-d Maybe you can test this one, too? Is an easy test I think. |
Contributor
|
I have tested this item ✅ successfully on 066cfde This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/26490. |
Contributor
|
Thanks! |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Pull Request for Issue #24535 (part).
Summary of Changes
This Pull Request (PR) changes com_checkin so that when you check in a checkout item not with the lock icon in the particular component's but with com_checkin, e.g. the "Checked out" view in backend, a real NULL value is written to the
checked_out_timecolumn of that component's database table if the table allows that (J4 core). If the table does not allow that (e.g. because belonging to a 3rd party extension which has not adapted yet to the null value support for datetimes in J4), the old (pseudo-)nulldates are written to thechecked_out_timecolumn of that component's database table like it was before.Testing Instructions
Pre-conditions: Clean, new installation of current 4.0-dev branch or a nightly 4.0-alpha12-dev build (or 4.0 Alpha-12 if already out) not older than the one from this morning (UTC).
Test A: Item with nullable checked_out_time
checked_out_timecolumn of the particular table (eg#__content,#__categories,#__contact_details...) in database eg with PhpMyAdmin or PhpPgAdmin, depending on your database.Result: '0000-00-00 00:00:00' with MySQL, '1970-01-01 00:00:00' with PostgreSQL database.
Repeat steps 1 to 4.
Result: NULL.
Test B: Item with not nullable checked_out_time, e.g. old 3rd party extension
To be extecuted directly after the previous Test A.
#__content(if testing with an article) or#__categories(if testing with an article) ... thenullproperty for columnchecked_out_timeso null values are not allowed anymore, and enter a valid default value, e.g. '1999-01-01 00:00:00'. (You could also use eg '0000-00-00 00:00:00' on MySQL like an old 3rd party extension would do, but if strict mode is enabled this will not be allowed, so better test with some other default).checked_out_timecolumn of the particular table (eg#__content,#__categories,#__contact_details...) in database eg with PhpMyAdmin or PhpPgAdmin, depending on your database.Result: '0000-00-00 00:00:00' with MySQL, '1970-01-01 00:00:00' with PostgreSQL database.
After test, don't forget to change back data structure to like it was before if you want to reuse the installation for other tests.
Expected result
Items being checked in with com_checkin will have column
checked_out_timewith real NULL value in their database table if the column allows NULL values. This is the case with Joomla 4 Core since this night.If the database table does not allow NULL values for column
checked_out_time, which might be the case for 3rd party extensions not being adapted to null value support for datetimes in J4, the old (pseduo-)nulldates ('0000-00-00 00:00:00' with MySQL, '1970-01-01 00:00:00' with PostgreSQL) are saved in that column.Actual result
Items being checked in with com_checkin will have
checked_out_timewith value '0000-00-00 00:00:00' in a MySQL or '1970-01-01 00:00:00' in a PostgreSQL database in any case.Documentation Changes Required
None.