I am a component developer and now I am migrating my component to Joomla 4.x.
In Joomla 3.x I could do code like:
$row= new stdClass();
$row->id = "2";
$row->user_id = "";
$row->anythind = "foo bar";
// Insert the object into the user profile table.
$result = JFactory::getDbo()->updateObject('#__test_table', $row, 'id');
Note that user_id is an empty string but in the DB is an integer type column. But once executed the DB value of user_id would be cero.
After upgrading to Joomla 4.4.3 the same code gives this error:
"1366 Incorrect integer value: '' for column database
.#__test_table
.user_id
at row 1"
Does not accept an empty string for a column of integers.
I have also tried it with the JTable::store() method and I have the same result.
With dozens of administration forms it is literally impossible to force all integer fields to have a zero and not simply leave them blank.
I appreciate any help you can give me on this.