Bug #21842 Clarification Requested

Setting model properties to NULL does not update DB table

Version: 3.3.0 Reporter: Manuel Payano

This is an archived bug report. If you are experiencing a similar issue, upgrade to the latest release and if that does not solve the problem, submit a new bug report

If a model exists and you set a property to NULL and save the model, that property is ignored and is not saved.

Example code

$coupon = ee('Model')->get('subs:Coupon', 123)->first();
$coupon->valid_from = null;
$coupon->save();
unset($coupon);

$coupon = ee('Model')->get('subs:Coupon', 123)->first();
echo $coupon->valid_from;
// 2016-04-23 12:00:00 (the previous value)
.(JavaScript must be enabled to view this email address)

ExpressionEngine News!

#eecms, #events, #releases