Skip to content

Commit

Permalink
Fixed issue #16460: Unable to update format or questionindex by plugin
Browse files Browse the repository at this point in the history
Dev : all attributes allowed
  • Loading branch information
Shnoulle authored and eddylackmann committed Jul 29, 2020
1 parent c8473f5 commit 408683d
Showing 1 changed file with 3 additions and 7 deletions.
10 changes: 3 additions & 7 deletions application/models/Survey.php
Expand Up @@ -506,14 +506,10 @@ public function afterFindSurvey()
$event = new PluginEvent('afterFindSurvey');
$event->set('surveyid', $this->sid);
App()->getPluginManager()->dispatchEvent($event);
// set the attributes we allow to be fixed
$allowedAttributes = array('template', 'usecookie', 'allowprev',
'showxquestions', 'shownoanswer', 'showprogress', 'questionindex',
'usecaptcha', 'showgroupinfo', 'showqnumcode', 'navigationdelay',
'expires','startdate','admin','adminemail','emailnotificationto','emailresponseto');
foreach ($allowedAttributes as $attribute) {
$aAttributes = array_keys($this->getAttributes());
foreach ($aAttributes as $attribute) {
if (!is_null($event->get($attribute))) {
$this->{$attribute} = $event->get($attribute);
$this->setAttribute($attribute,$event->get($attribute));
}
}
$this->template = Template::templateNameFilter($this->template);
Expand Down

0 comments on commit 408683d

Please sign in to comment.