?
avatar mvanvu
mvanvu
13 Mar 2020

As the title of this issue, JTable can't update the field to NULL

  1. For test edit the file /libraries/src/Table/Content.php change the line 318
    From public function store($updateNulls = false)
    To public function store($updateNulls = true)
  2. Edit an article and save it the I got an error like the image below
    Selection_002

Joomla 3.9.16
Database: 5.7.29-0ubuntu0.18.04.1
Php: 7.2.28-3+ubuntu18.04.1+deb.sury.org+1

avatar mvanvu mvanvu - open - 13 Mar 2020
avatar joomla-cms-bot joomla-cms-bot - change - 13 Mar 2020
Labels Added: ?
avatar joomla-cms-bot joomla-cms-bot - labeled - 13 Mar 2020
avatar richard67
richard67 - comment - 13 Mar 2020

The updateNulls parameter determines if null values are stored for table fields of type datetime (or on PostgreSQL: time stamp without time zone). Null values for datetimes are supported for J4 but not for J3. So this here is no issue, I think.

avatar richard67 richard67 - change - 13 Mar 2020
Status New Closed
Closed_Date 0000-00-00 00:00:00 2020-03-13 06:42:45
Closed_By richard67
avatar richard67
richard67 - comment - 13 Mar 2020

In Version 3 and before Joomla uses pseudo null date values (‘0000-00-00 00:00:00’ on MySQL and ‘1970-01-01 00:00:00’ on PostgreSQL) because real null values for datetimes wasn’t supported in old times on MySQL. This has been corrected in the 4.0-dev branch and so will be correct with Joomla 4. This uses real null values for datetimes. Closing as no issue.

avatar richard67 richard67 - close - 13 Mar 2020
avatar richard67
richard67 - comment - 13 Mar 2020

P.S.: Changing that in J3 would cause hard backward compatibility (b/c) breaks at many places.

Add a Comment

Login with GitHub to post a comment