From dea8c861a8bd3c13cd4c83d3f7a6837858a85dd8 Mon Sep 17 00:00:00 2001 From: Erik Amaru Ortiz Date: Fri, 3 Jun 2011 11:23:05 -0400 Subject: [PATCH] BUG 7022 adicionar un campo al dynaform aparece un "Notice" SOLVED --- gulliver/system/class.xmlform.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/gulliver/system/class.xmlform.php b/gulliver/system/class.xmlform.php index 8fbd6d833..8be33485e 100644 --- a/gulliver/system/class.xmlform.php +++ b/gulliver/system/class.xmlform.php @@ -4177,7 +4177,9 @@ class XmlForm if (isset ( $xmlNode [$k]->attributes ['required'] )) { // the fields or xml nodes with a required attribute are put in an array that is passed to the view file - if ($xmlNode [$k]->attributes ['required'] == 1 && $xmlNode [$k]->attributes['mode'] != 'view' && $this->mode == 'edit') + $isEditMode = isset($xmlNode[$k]->attributes['mode']) && $xmlNode[$k]->attributes['mode'] == 'view' ? false: true; + + if ($xmlNode [$k]->attributes ['required'] == 1 && $isEditMode && $this->mode != 'view') $this->requiredFields [] = array ('name' => $field->name, 'type' => $xmlNode [$k]->attributes ['type'], 'label' => trim ( $field->label ) ); }