MDL-55804 forms: Return exported data through _prepareValue
This commit is contained in:
@@ -285,7 +285,6 @@ class MoodleQuickForm_date_time_selector extends MoodleQuickForm_group {
|
||||
* @return array
|
||||
*/
|
||||
function exportValue(&$submitValues, $assoc = false) {
|
||||
$value = null;
|
||||
$valuearray = array();
|
||||
foreach ($this->_elements as $element){
|
||||
$thisexport = $element->exportValue($submitValues[$this->getName()], true);
|
||||
@@ -297,8 +296,7 @@ class MoodleQuickForm_date_time_selector extends MoodleQuickForm_group {
|
||||
if($this->_options['optional']) {
|
||||
// If checkbox is on, the value is zero, so go no further
|
||||
if(empty($valuearray['enabled'])) {
|
||||
$value[$this->getName()] = 0;
|
||||
return $value;
|
||||
return $this->_prepareValue(0, $assoc);
|
||||
}
|
||||
}
|
||||
// Get the calendar type used - see MDL-18375.
|
||||
@@ -308,7 +306,7 @@ class MoodleQuickForm_date_time_selector extends MoodleQuickForm_group {
|
||||
$valuearray['day'],
|
||||
$valuearray['hour'],
|
||||
$valuearray['minute']);
|
||||
$value[$this->getName()] = make_timestamp($gregoriandate['year'],
|
||||
$value = make_timestamp($gregoriandate['year'],
|
||||
$gregoriandate['month'],
|
||||
$gregoriandate['day'],
|
||||
$gregoriandate['hour'],
|
||||
@@ -317,7 +315,7 @@ class MoodleQuickForm_date_time_selector extends MoodleQuickForm_group {
|
||||
$this->_options['timezone'],
|
||||
true);
|
||||
|
||||
return $value;
|
||||
return $this->_prepareValue($value, $assoc);
|
||||
} else {
|
||||
return null;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user