Skip to content

Commit

Permalink
Fixed issue #16529: After deleting a user who owned a survey, the sur…
Browse files Browse the repository at this point in the history
…vey list generates a dump (#1513)

Added getOwnerUserName in Survey model, and use that ownerUserName property in listSurveys.php.
  • Loading branch information
gabrieljenik committed Aug 10, 2020
1 parent be147d5 commit 4b0890a
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
Expand Up @@ -86,7 +86,7 @@
'header' => gT('Owner'),
'name' => 'owner',
'type' => 'raw',
'value'=>'CHtml::link(CHtml::encode($data->oOptions->owner["users_name"]), Yii::app()->createUrl("admin/survey/sa/view/",array("surveyid"=>$data->sid)))',
'value'=>'CHtml::link(CHtml::encode($data->ownerUserName), Yii::app()->createUrl("admin/survey/sa/view/",array("surveyid"=>$data->sid)))',
'headerHtmlOptions'=>array('class' => 'hidden-md hidden-sm hidden-xs'),
'htmlOptions' => array('class' => 'hidden-md hidden-sm hidden-xs has-link'),
),
Expand Down
8 changes: 8 additions & 0 deletions application/models/Survey.php
Expand Up @@ -2069,4 +2069,12 @@ public function setToInherit()
}
}

/**
* @return string
*/
public function getOwnerUserName()
{
return isset($this->owner["users_name"]) ? $this->owner["users_name"] : "";
}

}

0 comments on commit 4b0890a

Please sign in to comment.