No Code Attached Yet
avatar RustyIngles
RustyIngles
15 Oct 2025

Description
When editing an article (or any record that uses Joomla\CMS\Table\Table::checkIn()), clicking Close triggers:

Column 'checked_out' cannot be null

Stack trace excerpt

Joomla\Database\Exception\ExecutionFailureException: Column 'checked_out' cannot be null
#2 /libraries/src/Table/Table.php(1238)
#3 /libraries/src/MVC/Model/FormModel.php(111)
...

Cause
Table::checkIn() builds this SQL:

$nullDate = $this->_supportNullValue ? 'NULL' : $this->_db->quote($this->_db->getNullDate());
$nullID   = $this->_supportNullValue ? 'NULL' : '0';

Since _supportNull Value is true in 5.3.x, Joomla issues:

UPDATE #__content
SET checked_out = NULL,
    checked_out_time = NULL

However, in the core schema for #__content, both checked_out and checked_out_time are declared NOT NULL DEFAULT 0/0000-00-00 00:00:00,
so strict-mode MySQL rejects the query.

Steps to Reproduce

  1. Use Joomla 5.3.4 with a default schema on MySQL 8.0 (strict mode on)

  2. Edit any article

  3. Click Close

Expected result

  • Article closes normally.

Actual result

  • Error 1048 – “Column 'checked_out' cannot be null”.

System information (as much as possible)

Environment

  • Joomla 5.3.4 Stable
  • PHP 8.3 (FPM / CLI)
  • MySQL 8.0 / MariaDB 10.11 (STRICT TRANS TABLES enabled)

Suggested fix

In /libraries/src/Table/Table.php → checkIn(), always use non-NULL safe values:

$nullDate = $this->_db->quote($this->_db->getNullDate());
$nullID   = '0';

or guard it conditionally against field definitions.

Workaround

Patch that line manually or override via a small system plugin.

avatar RustyIngles RustyIngles - open - 15 Oct 2025
avatar joomla-cms-bot joomla-cms-bot - change - 15 Oct 2025
Labels Added: No Code Attached Yet
avatar joomla-cms-bot joomla-cms-bot - labeled - 15 Oct 2025
avatar richard67
richard67 - comment - 15 Oct 2025

However, in the core schema for #__content, both checked_out and checked_out_time are declared NOT NULL DEFAULT 0/0000-00-00 00:00:00, so strict-mode MySQL rejects the query.

@RustyIngles Then an update SQL script "4.0.0-2020-05-29.sql" has not been executed when you had updated from Joomla 3 to Joomla 4 in past, because these database columns were changed with Joomla 4. Or you have migrated your data somehow from Joomla 3 to Joomla 4 and the change in the structure was not done or reverted by that mingration.

avatar richard67
richard67 - comment - 15 Oct 2025

P.S.: As you can see here, the column allows NULL values in Joomla 5: https://github.com/joomla/joomla-cms/blob/5.4-dev/installation/sql/mysql/extensions.sql#L159-L199 . The database checker does not show that as an error because on Joomla 5 it cannot check the update SQL scripts from Joomla 4 because those are removed by the update from 4 to 5. But you should have seen that error in the database checker when being on 4. Or as said, some 3rd party migration tool messes something up for you.

Add a Comment

Login with GitHub to post a comment