Skip to content

Commit

Permalink
Fixed issue #16982: Server error if template are invalid
Browse files Browse the repository at this point in the history
Dev: setOptions after fix current template
  • Loading branch information
Shnoulle committed Jan 16, 2021
1 parent 6f408e4 commit c5ed64b
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions application/models/Survey.php
Expand Up @@ -546,7 +546,9 @@ public function rules()

/**
* afterFindSurvey to fix and/or add some survey attribute
* - event afterFindSurvey (for all attributes)
* - Fix template name to be sure template exist
* - setOptions for inherited value
*/
public function afterFindSurvey()
{
Expand All @@ -559,13 +561,11 @@ public function afterFindSurvey()
$this->setAttribute($attribute,$event->get($attribute));
}
}

// set inherited values for existing survey
$this->setOptions($this->gsid);

if ($this->template != 'inherit'){
$this->template = Template::templateNameFilter($this->template);
}
/* this is fixed, setOptions for inherited after all */
$this->setOptions($this->gsid);
}


Expand Down

0 comments on commit c5ed64b

Please sign in to comment.