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
Dev: Cherry-picked
  • Loading branch information
Shnoulle committed Jan 16, 2021
1 parent bcc6220 commit 9c4d4d1
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions application/models/Survey.php
Expand Up @@ -543,7 +543,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 @@ -556,13 +558,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 9c4d4d1

Please sign in to comment.