Tab Prestudent: use false for boolean and null for other variables for update if field is empty

This commit is contained in:
ma0068
2025-08-14 13:15:10 +02:00
parent 5e7514ffff
commit 4d78abf9ec
@@ -142,15 +142,15 @@ class Prestudent extends FHCAPI_Controller
$update_prestudent[$prop] = $val;
}
// allowed to be null, but has to be in postparameter
if (
in_array($prop, ['zgvdatum', 'zgvmadatum', 'zgvdoktordatum', 'zgv_code', 'zgvmas_code', 'zgvdoktor_code'])
&& !isset($update_prestudent[$prop])
&& array_key_exists($prop, $_POST)
)
{
//set null instead of empty string
if ($val === '' && ($prop != 'dual' || $prop != 'bismelden')){
$update_prestudent[$prop] = null;
}
//set false instead of empty string if boolean
if ($val === '' && ($prop === 'dual' || $prop === 'bismelden')) {
$update_prestudent[$prop] = false;
}
}
$update_prestudent['updateamum'] = date('c');