The "item" is checked in by the scheduled task.
The task returns error code -2, resulting in task failure email if configured to send emails on failure.
Joomla 5.3.2
MySQL 8.0.36
GlobalCheckin plugin 5.0.0
PHP 8.3.15
The globalcheckin plugin (version 5.0.0) does not cater properly for tables with "NULL not allowed" in the checked_out column. The code ~/plugins/task/globalcheckin/src/Extension/GlobalCheckin.php caters for both "not NULL" and null allowed in the WHERE clause but tries to set the checked_out column field value to NULL when expired checked out rows are found irrespective of NULL being allowed or not.
Changing the code:
$query = $db->getQuery(true)
->update($db->quoteName($tn))
->set($db->quoteName('checked_out') . ' = NULL')
->set($db->quoteName('checked_out_time') . ' = NULL');
if ($fields['checked_out']->Null === 'YES') {
$query->where($db->quoteName('checked_out') . ' IS NOT NULL');
} else {
$query->where($db->quoteName('checked_out') . ' > 0');
}
to:
$query = $db->getQuery(true)
->update($db->quoteName($tn))
->set($db->quoteName('checked_out_time') . ' = NULL');
if ($fields['checked_out']->Null === 'YES') {
$query->set($db->quoteName('checked_out') . ' = NULL')
->where($db->quoteName('checked_out') . ' IS NOT NULL');
} else {
$query->set($db->quoteName('checked_out') . ' = 0')
->where($db->quoteName('checked_out') . ' > 0');
}
Fixes the problem
Labels |
Removed:
?
|
Labels |
Added:
No Code Attached Yet
|
Status | New | ⇒ | Closed |
Closed_Date | 0000-00-00 00:00:00 | ⇒ | 2025-01-21 10:30:55 |
Closed_By | ⇒ | chmst |
the nature of that field is to allow NULL value, so declaring NOT NULL is wrong imho