? Pending

User tests: Successful: Unsuccessful:

avatar Hackwar
Hackwar
29 May 2020

The checked_out fields so far had the behaviour that items were checked out when the value was >0 and not checked out when it was equal to 0. From a theoretical standpoint, 0 here is a magic number and we should avoid that. So we should change that to using a real NULL value for checked-in items and a positive integer for checked-out items.

However, if this were just a theoretical exercise this wouldn't be a big issue. However we are now using NULL-aware table classes and we either need to add checks in each NULL-aware table class to fill the checked_out column with a 0 value or we need to make the change that this PR does. Otherwise a not-set checked_out column results in a failure when storing the table content. This can be seen in #29217.

This PR also unifies all checked_out columns to be an unsigned integer instead of INT(11), bigint, signed or whatever.

avatar Hackwar Hackwar - open - 29 May 2020
avatar Hackwar Hackwar - change - 29 May 2020
Status New Pending
avatar joomla-cms-bot joomla-cms-bot - change - 29 May 2020
Category Administration com_admin SQL Postgresql com_banners com_categories com_contact com_content com_fields com_finder com_installer com_languages com_menus
avatar HLeithner
HLeithner - comment - 29 May 2020

Nice PR you know hat we use === null and not is_null normally?

avatar Hackwar Hackwar - change - 29 May 2020
Labels Added: ?
avatar Hackwar Hackwar - change - 29 May 2020
The description was changed
avatar Hackwar Hackwar - edited - 29 May 2020
avatar wilsonge
wilsonge - comment - 29 May 2020

@Hackwar @richard67 RE: your comments technically the issues are the updateNulls param in the \Joomla\CMS\Table\Table::store() function. I think however we can safely rely on people using the dedicated checkIn and checkOut methods and document the change in the backwards compat docs

avatar wilsonge wilsonge - close - 29 May 2020
avatar wilsonge wilsonge - merge - 29 May 2020
avatar wilsonge wilsonge - change - 29 May 2020
Status Pending Fixed in Code Base
Closed_Date 0000-00-00 00:00:00 2020-05-29 20:40:43
Closed_By wilsonge
avatar wilsonge
wilsonge - comment - 29 May 2020

Thanks!

avatar infograf768
infograf768 - comment - 30 May 2020

@wilsonge @Hackwar
this is a B/C break. I hope you know.

avatar brianteeman
brianteeman - comment - 30 May 2020

never mind a b/c break it doesnt work and breaks everything

avatar wilsonge
wilsonge - comment - 30 May 2020

@brianteeman can you elaborate. All of core seems to work fine to me. And #29272 will fix JM's issue I believe

Add a Comment

Login with GitHub to post a comment