Skip to content

Commit

Permalink
LSC-267: check if responsetable exists before checking responsemodel …
Browse files Browse the repository at this point in the history
…data exists
  • Loading branch information
ptelu committed Sep 12, 2022
1 parent 9e0097e commit 00d0a04
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions application/models/FailedEmail.php
Expand Up @@ -210,10 +210,14 @@ public function getButtons(): string
*/
public function getResponseUrl(): string
{
$response = Response::model($this->surveyid)->findByPk($this->responseid);
if (!empty($response)) {
$responseUrl = App()->createUrl("responses/view/", ['surveyId' => $this->surveyid, 'id' => $this->responseid]);
$responseLink = '<a href="' . $responseUrl . '" role="button" data-toggle="tooltip" title="' . gT('View response details') . '">' . $this->responseid . '</a>';
if (Survey::model()->findByPk($this->surveyid)->hasResponsesTable) {
$response = Response::model($this->surveyid)->findByPk($this->responseid);
if (!empty($response)) {
$responseUrl = App()->createUrl("responses/view/", ['surveyId' => $this->surveyid, 'id' => $this->responseid]);
$responseLink = '<a href="' . $responseUrl . '" role="button" data-toggle="tooltip" title="' . gT('View response details') . '">' . $this->responseid . '</a>';
} else {
$responseLink = (string)$this->responseid;
}
} else {
$responseLink = (string)$this->responseid;
}
Expand Down

0 comments on commit 00d0a04

Please sign in to comment.