? Pending

User tests: Successful: Unsuccessful:

avatar richard67
richard67
6 Oct 2019

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_time column 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 the checked_out_time column 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

  1. Make any item eg article, category, contact, ... be checked out, eg by editing and then going to some other url in the admin area by typing the other url into the browser's url field.
  2. Go to the sytem dashboard and then to "Global Check-in".
  3. Select the item and check it in using the button at the top.
  4. Check the checked_out_time column 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.
  5. Apply the patch of this PR eg with patchtester.
    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.

  1. Using PhpMyAdmin or PhpPgAdmin (depending on your database), change in table structure eg of table #__content (if testing with an article) or #__categories (if testing with an article) ... the null property for column checked_out_time so 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).
  2. Make any item eg article, category, contact, ... be checked out, eg by editing and then going to some other url in the admin area by typing the other url into the browser's url field.
  3. Go to the sytem dashboard and then to "Global Check-in".
  4. Select the item and check it in using the button at the top.
  5. Check the checked_out_time column 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_time with 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_time with 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.

avatar richard67 richard67 - open - 6 Oct 2019
avatar richard67 richard67 - change - 6 Oct 2019
Status New Pending
avatar joomla-cms-bot joomla-cms-bot - change - 6 Oct 2019
Category Administration com_checkin
avatar richard67 richard67 - change - 6 Oct 2019
The description was changed
avatar richard67 richard67 - edited - 6 Oct 2019
avatar richard67 richard67 - change - 16 Oct 2019
Title
[4.0] [WiP] [com_checkin] Use NULL for checked_out_time columns when checking in items
[4.0] [com_checkin] Use NULL for checked_out_time columns when checking in items
avatar richard67 richard67 - edited - 16 Oct 2019
avatar richard67 richard67 - change - 16 Oct 2019
The description was changed
avatar richard67 richard67 - edited - 16 Oct 2019
avatar richard67 richard67 - change - 16 Oct 2019
Labels Added: ?
avatar richard67 richard67 - change - 16 Oct 2019
The description was changed
avatar richard67 richard67 - edited - 16 Oct 2019
avatar richard67
richard67 - comment - 16 Oct 2019

@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 ;-)

avatar richard67
richard67 - comment - 17 Oct 2019

Please wait until I've reported back there that I have tested it myself.

avatar richard67 richard67 - change - 17 Oct 2019
The description was changed
avatar richard67 richard67 - edited - 17 Oct 2019
avatar richard67 richard67 - change - 17 Oct 2019
The description was changed
avatar richard67 richard67 - edited - 17 Oct 2019
avatar richard67 richard67 - change - 17 Oct 2019
The description was changed
avatar richard67 richard67 - edited - 17 Oct 2019
avatar richard67
richard67 - comment - 17 Oct 2019

Ready for test.
@SharkyKZ @alikon @Quy Could you test this?
Ping @wilsonge for review.

avatar richard67 richard67 - change - 17 Oct 2019
The description was changed
avatar richard67 richard67 - edited - 17 Oct 2019
avatar richard67
richard67 - comment - 19 Oct 2019

@roland-d Maybe you can test this one, too? Is an easy test I think.

avatar Quy Quy - test_item - 19 Oct 2019 - Tested successfully
avatar Quy
Quy - comment - 19 Oct 2019

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.

avatar wilsonge wilsonge - close - 19 Oct 2019
avatar wilsonge wilsonge - merge - 19 Oct 2019
avatar wilsonge wilsonge - change - 19 Oct 2019
Status Pending Fixed in Code Base
Closed_Date 0000-00-00 00:00:00 2019-10-19 22:06:41
Closed_By wilsonge
avatar wilsonge
wilsonge - comment - 19 Oct 2019

Thanks!

Add a Comment

Login with GitHub to post a comment