PHP 8 Error on line 114 in single_crud_class.inc fixed.
authorJoe Hunt <joe.hunt.consulting@gmail.com>
Sat, 4 Dec 2021 08:34:55 +0000 (09:34 +0100)
committerJoe Hunt <joe.hunt.consulting@gmail.com>
Sat, 4 Dec 2021 08:34:55 +0000 (09:34 +0100)
includes/ui/simple_crud_class.inc

index 40c8ebea6b29b5653b2a746284015329473dee33..2669bf043e0fbf51fd583ea87f999744f1d1eb69 100644 (file)
@@ -111,7 +111,7 @@ class simple_crud {
                        if (isset($_POST[$this->name.$m])) {
                                unset($_POST['_focus']); // focus on first form entry
                                $Ajax->activate($this->name.'_div');
-                               $val = @key($_POST[$this->name.$m]);
+                               $val = is_array($_POST[$this->name.$m]) ? key($_POST[$this->name.$m]) : null;
                                $this->selected_id = $val!==null ? @quoted_printable_decode($val) : $this->_none;
                                return $m;
                        }