APIv4 - Use empty string instead of 'null' to pass null values to the database
authorColeman Watts <coleman@civicrm.org>
Thu, 20 Jan 2022 21:34:48 +0000 (16:34 -0500)
committerColeman Watts <coleman@civicrm.org>
Thu, 20 Jan 2022 21:34:48 +0000 (16:34 -0500)
commit236737d5c7cff529f06948a6994d284b81f4d5b7
tree6fd6ab22b7436bd6551be87b1c0a4961af510cd8
parentc04fbefb26fc8adf1aa4d9693e7a79d08420e8da
APIv4 - Use empty string instead of 'null' to pass null values to the database

`CRM_Core_DAO::copyValues()` already converts '' to 'null', and passing the string 'null'
into `BAO::writeRecords` or `BAO::create` functions prematurely can introduce subtle bugs
because the string 'null' is `!empty()` whereas '' is `empty()`.
Civi/Api4/Generic/Traits/DAOActionTrait.php
Civi/Api4/Utils/FormattingUtil.php