PHP 8 error on line 257 in simple_crud_class.inc fixed.
authorJoe Hunt <joe.hunt.consulting@gmail.com>
Sat, 4 Dec 2021 09:36:20 +0000 (10:36 +0100)
committerJoe Hunt <joe.hunt.consulting@gmail.com>
Sat, 4 Dec 2021 09:36:20 +0000 (10:36 +0100)
includes/ui/simple_crud_class.inc

index 2669bf043e0fbf51fd583ea87f999744f1d1eb69..f6375635ebaa6e3bcbac799342b099adbc50241b 100644 (file)
@@ -254,10 +254,10 @@ class simple_crud {
                        $post = isset($fmt['post']) ? $fmt['post'] : $name;
                        $fld = isset($fmt['fld']) ? $fmt['fld'] : $name;
 
-                       $value = $this->selected_id == $this->_none ? @$fmt['dflt'] :
+                       $value = $this->selected_id == $this->_none ? (isset($fmt['dflt']) ? $fmt['dflt'] : null) :
                                (is_array($this->data) ? $this->data[$fld]: $this->data->$fld);
 
-                       $_POST[$post] = $this->_format_output($value, @$fmt['fmt']);
+                       $_POST[$post] = $this->_format_output($value, isset($fmt['fmt']) ? $fmt['fmt'] : null);
                }
        }
        //--------------------------