Skip to content

Commit

Permalink
LSC-267: added dp update for latest changes in failed_emails
Browse files Browse the repository at this point in the history
LSC-267: fixed responselink display condition
  • Loading branch information
ptelu committed Sep 12, 2022
1 parent 00d0a04 commit 3a6ef60
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 2 deletions.
2 changes: 1 addition & 1 deletion application/config/version.php
Expand Up @@ -12,7 +12,7 @@
*/

$config['versionnumber'] = '5.4.0';
$config['dbversionnumber'] = 490;
$config['dbversionnumber'] = 491;
$config['buildnumber'] = '';
$config['updatable'] = true;
$config['templateapiversion'] = 3;
Expand Down
26 changes: 26 additions & 0 deletions application/helpers/update/updates/Update_491.php
@@ -0,0 +1,26 @@
<?php

namespace LimeSurvey\Helpers\Update;

class Update_491 extends DatabaseUpdateBase
{
public function up()
{
$responseidColumn = $this->db->getSchema()->getTable('{{failed_emails}}')->getColumn('responseid');
if ($responseidColumn === null) {
$this->db->createCommand()->addColumn(
'{{failed_emails}}',
'responseid',
"integer NOT NULL"
);
}
$resendVarsColumn = $this->db->getSchema()->getTable('{{failed_emails}}')->getColumn('resend_vars');
if ($resendVarsColumn === null) {
$this->db->createCommand()->addColumn(
'{{failed_emails}}',
'resend_vars',
"text NOT NULL"
);
}
}
}
3 changes: 2 additions & 1 deletion application/models/FailedEmail.php
Expand Up @@ -210,7 +210,8 @@ public function getButtons(): string
*/
public function getResponseUrl(): string
{
if (Survey::model()->findByPk($this->surveyid)->hasResponsesTable) {
$survey = Survey::model()->findByPk($this->surveyid);
if ( $survey !== null && $survey->hasResponsesTable) {
$response = Response::model($this->surveyid)->findByPk($this->responseid);
if (!empty($response)) {
$responseUrl = App()->createUrl("responses/view/", ['surveyId' => $this->surveyid, 'id' => $this->responseid]);
Expand Down

0 comments on commit 3a6ef60

Please sign in to comment.