diff --git a/include/class.dynamic_forms.php b/include/class.dynamic_forms.php index 8da97a335e8da22bc2dd5d6e75d28a098fcdc686..173b090587986ddf06c0acf6abe8147f357b6831 100644 --- a/include/class.dynamic_forms.php +++ b/include/class.dynamic_forms.php @@ -429,11 +429,18 @@ class DynamicFormField extends VerySimpleModel { } function getField($cache=true) { + global $thisstaff; + if (!$cache) return new FormField($this->ht); + // Finagle the `required` flag for the FormField instance + $ht = $this->ht; + $ht['required'] = ($thisstaff) ? $this->isRequiredForStaff() + : $this->isRequiredForUsers(); + if (!isset($this->_field)) - $this->_field = new FormField($this->ht); + $this->_field = new FormField($ht); return $this->_field; }