Skip to content
Snippets Groups Projects
Commit ae02af9a authored by Peter Rotich's avatar Peter Rotich
Browse files

Merge pull request #6 from greezybacon/issue/external-fields


forms: Always index the _fields listing

Reviewed-By: default avatarPeter Rotich <peter@osticket.com>
parents b1bd4f25 e39f7869
No related branches found
No related tags found
No related merge requests found
......@@ -715,12 +715,11 @@ class DynamicFormEntry extends VerySimpleModel {
// Get answers to entries
foreach ($this->getAnswers() as $a) {
if (!($f = $a->getField())) continue;
if (isset($this->_fields[$f->get('id')]))
$this->_fields[$f->get('id')] = $f;
else { // Perhaps an answer of deleted field
// Perhaps an answer of deleted field
if (!isset($this->_fields[$f->get('id')])) {
$f->setForm($this);
$this->_fields[] = $f;
}
$this->_fields[$f->get('id')] = $f;
}
}
......@@ -903,7 +902,7 @@ class DynamicFormEntry extends VerySimpleModel {
$a->deleted = false;
// Add to list of answers
$this->_values[] = $a;
$this->_fields[] = $field;
$this->_fields[$field->get('id')] = $field;
$this->_form = null;
// Omit fields without data
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment