diff --git a/application/forms.class.inc.php b/application/forms.class.inc.php
index eadd1661b..a28d5154c 100644
--- a/application/forms.class.inc.php
+++ b/application/forms.class.inc.php
@@ -1223,7 +1223,7 @@ class DesignerComboField extends DesignerFormField
$sChecked = $this->defaultValue ? 'checked' : '';
$sMandatory = $this->bMandatory ? 'true' : 'false';
$sReadOnly = $this->IsReadOnly() ? 'disabled="disabled"' : '';
- if ($this->IsSorted())
+ if ($this->IsSorted() && isset($this->aAllowedValues) )
{
asort($this->aAllowedValues);
}
@@ -1271,19 +1271,17 @@ class DesignerComboField extends DesignerFormField
$sHtml .= "";
}
}
- foreach($this->aAllowedValues as $sKey => $sDisplayValue)
- {
- if ($this->bMultipleSelection)
- {
- $sSelected = in_array($sKey, $this->defaultValue) ? 'selected' : '';
+ if ( isset($this->aAllowedValues) ) {
+ foreach ($this->aAllowedValues as $sKey => $sDisplayValue) {
+ if ($this->bMultipleSelection) {
+ $sSelected = in_array($sKey, $this->defaultValue) ? 'selected' : '';
+ } else {
+ $sSelected = ($sKey == $this->defaultValue) ? 'selected' : '';
+ }
+ // Quick and dirty: display the menu parents as a tree
+ $sHtmlValue = str_replace(' ', ' ', $sDisplayValue);
+ $sHtml .= "";
}
- else
- {
- $sSelected = ($sKey == $this->defaultValue) ? 'selected' : '';
- }
- // Quick and dirty: display the menu parents as a tree
- $sHtmlValue = str_replace(' ', ' ', htmlentities($sDisplayValue, ENT_QUOTES, 'UTF-8'));
- $sHtml .= "";
}
$sHtml .= "";
if ($this->bOtherChoices)
diff --git a/pages/ajax.render.php b/pages/ajax.render.php
index 8df024513..fbe25a152 100644
--- a/pages/ajax.render.php
+++ b/pages/ajax.render.php
@@ -1368,7 +1368,16 @@ EOF
foreach($aUpdatedProperties as $sProp)
{
$sDecodedProp = str_replace('attr_', '', $sProp); // Remove the attr_ prefix
- $aCurrentValues[$sDecodedProp] = (isset($aPreviousValues[$sProp]) ? $aPreviousValues[$sProp] : ''); // Set the previous value
+ // Set the previous value
+ if ( isset($aPreviousValues[$sProp]) && $aPreviousValues[$sProp] != '' ){
+ $aCurrentValues[$sDecodedProp] = $aPreviousValues[$sProp];
+ } else {
+ if(gettype($aCurrentValues[$sDecodedProp]) == "array") {
+ $aCurrentValues[$sDecodedProp] = [];
+ } else {
+ $aCurrentValues[$sDecodedProp] = '';
+ }
+ }
$aUpdatedDecoded[] = $sDecodedProp;
}