Questtype ?textinput?: initialize list of fields if none has been entered

This commit is contained in:
oliver 2015-08-18 19:11:49 +02:00
parent 94d1821f79
commit a328e71613

View file

@ -233,10 +233,10 @@
throw new \nre\exceptions\ParamsNotValidException('text');
}
$text = $this->request->getPostParam('text');
if(is_null($this->request->getPostParam('fields'))) {
throw new \nre\exceptions\ParamsNotValidException('fields');
}
$fields = $this->request->getPostParam('fields');
if(is_null($fields) && !is_array($fields)) {
$fields = array();
}
$fields = array_values($fields);
$fieldIndex = 0;
foreach($fields as &$field)