Fixed saving empty vlans

This commit is contained in:
Frank Schubert
2021-06-29 22:58:11 +02:00
parent 9d643fdfa2
commit 7353885310
3 changed files with 10 additions and 4 deletions
+5 -1
View File
@@ -26,7 +26,11 @@ class PopModel {
foreach($data as $field => $value) {
if(property_exists(get_called_class(), $field)) {
$model ->$field = $value;
if(substr($field, 0, 5) == "vlan_" && !$value) {
$model->$field = null;
continue;
}
$model->$field = $value;
}
}