mirror of
https://github.com/FH-Complete/FHC-Core.git
synced 2026-07-16 22:42:16 +00:00
Tab Prestudent: use false for boolean and null for other variables for update if field is empty
This commit is contained in:
@@ -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');
|
||||
|
||||
Reference in New Issue
Block a user