Skip to content
Browse files

MDL-32785 - lib - Ignorning hard frozen fields when submitting data.

  • Loading branch information...
1 parent ab88177 commit 919105e5d138f967a4fa4f5fecb2d7f2dbfa342a @abgreeve abgreeve committed with Sam Hemelryk Aug 30, 2012
Showing with 7 additions and 4 deletions.
  1. +7 −4 lib/formslib.php
View
11 lib/formslib.php
@@ -1669,10 +1669,14 @@ function exportValues($elementList = null){
$unfiltered = array();
if (null === $elementList) {
// iterate over all elements, calling their exportValue() methods
- $emptyarray = array();
foreach (array_keys($this->_elements) as $key) {
- if ($this->_elements[$key]->isFrozen() && !$this->_elements[$key]->_persistantFreeze){
- $value = $this->_elements[$key]->exportValue($emptyarray, true);
+ if ($this->_elements[$key]->isFrozen() && !$this->_elements[$key]->_persistantFreeze) {
+ $varname = $this->_elements[$key]->_attributes['name'];
+ $value = '';
+ // If we have a default value then export it.
+ if (isset($this->_defaultValues[$varname])) {
+ $value = array($varname => $this->_defaultValues[$varname]);
+ }
} else {
$value = $this->_elements[$key]->exportValue($this->_submitValues, true);
}
@@ -1699,7 +1703,6 @@ function exportValues($elementList = null){
if (is_array($this->_constantValues)) {
$unfiltered = HTML_QuickForm::arrayMerge($unfiltered, $this->_constantValues);
}
-
return $unfiltered;
}

0 comments on commit 919105e

Please sign in to comment.
Something went wrong with that request. Please try again.