Child element remains checked out when parent edited

ghicar

Member
This is a low priority/impact issue but thought I should report it. If you edit a parent element that has child elements, when you finish editing and save the parent the child elements remain checked out.
On inspection of the #_fabrik_elements table, the checked_out field is set to the user_id with a checked_out_time field set to "0000-00-00 00:00:00".

Also note that the field #_fabrik_elements.checked_out has a database configuration that does not allow NULL. A side effect of this is it exposes an error in the Joomla global checkin task plugin. If you use this plugin then when it is run it results in error code -2 if there are checked out elements that have been checked out for long enough. It looks like the Joomla code in ~/plugins/task/globalcheckin/src/Extension/GlobalCheckin.php does not properly cater for when the checked_out column does not allow NULLs as it tries to update the value of #_fabrik_elements.checked_out to NULL.

Appreciate there are two bugs here, one in Fabrik for not checking in child elements the other is a Joomla bug which I have reported (#44727).

Joomla 5.2.3
Fabrik 4.5
MySQL 8.0.36
PHP 8.3.15
 
If you edit a parent element that has child elements, when you finish editing and save the parent the child elements remain checked out.
On inspection of the #_fabrik_elements table, the checked_out field is set to the user_id with a checked_out_time field set to "0000-00-00 00:00:00".
This not bug but feature: It will show the admin that some settings of the child element may have changed.

#_fabrik_elements.checked_out has a database configuration that does not allow NULL.
As it seems the J! core tables have allow NULL, default NULL since J!4 maybe we should change it for the #_fabrik tables, too.
 
If you use this plugin then when it is run it results in error code -2 if there are checked out elements that have been checked out for long enough.
I just tested (J!5.2.2) and didn't get an error if using J!'s global check-in to check in Fabrik elements or visualisations (even with checked_out_time 2024-07-15).
It's setting `checked_out_time` back to NULL and `checked_out` to 0 (the Fabrik default).

How did you get the error?
 
Ah, ok.

At least J! should be consistent: use the column default in admin checkin and scheduled task or use NULL in both cases.

For backward compatibility it would be better if they took the default.
 

Members online

No members online now.
Back
Top