Skip to content

Commit 0ffa333

Browse files
authored
Merge pull request #2163 from Hafsa-Naeem/i10962-stable-3_5_0-fix
I10962 stable 3 5 0 fix
2 parents e91ec6e + 9cb395e commit 0ffa333

File tree

5 files changed

+13
-28
lines changed

5 files changed

+13
-28
lines changed

classes/emailTemplate/DAO.php

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
<?php
2+
23
/**
34
* @file classes/emailTemplate/DAO.php
45
*
@@ -21,9 +22,10 @@ class DAO extends \PKP\emailTemplate\DAO
2122
protected function variablesToRename(): array
2223
{
2324
return [
24-
'contextName' => 'pressName',
25-
'contextUrl' => 'pressUrl',
26-
'contextSignature' => 'pressSignature',
25+
'pressName' => 'contextName',
26+
'pressUrl' => 'contextUrl',
27+
'pressSignature' => 'contextSignature',
28+
'pressAcronym' => 'contextAcronym'
2729
];
2830
}
2931
}

classes/mail/variables/ContextEmailVariable.php

Lines changed: 0 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -20,24 +20,6 @@
2020

2121
class ContextEmailVariable extends PKPContextEmailVariable
2222
{
23-
public const CONTEXT_NAME = 'pressName';
24-
public const CONTEXT_URL = 'pressUrl';
25-
public const CONTEXT_SIGNATURE = 'pressSignature';
26-
public const CONTEXT_ACRONYM = 'contextAcronym';
27-
28-
/**
29-
* @copydoc Variable::descriptions()
30-
*/
31-
public static function descriptions(): array
32-
{
33-
return array_merge(
34-
parent::descriptions(),
35-
[
36-
static::CONTEXT_ACRONYM => __('emailTemplate.variable.context.contextAcronym'),
37-
]
38-
);
39-
}
40-
4123
/**
4224
* @copydoc Variable::values()
4325
*/
@@ -48,7 +30,6 @@ public function values(string $locale): array
4830
// Pass the values into the context signature so variables
4931
// used in the signature can be rendered.
5032
$values[static::CONTEXT_SIGNATURE] = $this->getContextSignature($values);
51-
$values[static::CONTEXT_ACRONYM] = htmlspecialchars($this->context->getLocalizedData('acronym'));
5233

5334
return $values;
5435
}

classes/migration/upgrade/v3_4_0/InstallEmailTemplates.php

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -47,10 +47,6 @@ protected function getEmailTemplateKeys(): array
4747

4848
protected function getAppVariableNames(): array
4949
{
50-
return [
51-
'contextName' => 'pressName',
52-
'contextUrl' => 'pressUrl',
53-
'contextSignature' => 'pressSignature',
54-
];
50+
return [];
5551
}
5652
}

dbscripts/xml/upgrade.xml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,7 @@
9797
<migration class="PKP\migration\upgrade\v3_4_0\I7249_UpdateUsersUniqueIndex"/>
9898
</upgrade>
9999

100+
100101
<upgrade minversion="3.1.0.0" maxversion="3.4.0.1">
101102
<migration class="PKP\migration\upgrade\v3_4_0\I9136_MigrateUniqueSiteId"/>
102103
<migration class="APP\migration\upgrade\v3_4_0\I9231_FixMetricsIndexes"/>
@@ -117,6 +118,10 @@
117118
<migration class="APP\migration\upgrade\v3_4_0\I9822_ChangeUsageStatsTemporaryTablesIndexes"/>
118119
</upgrade>
119120

121+
<upgrade minversion="3.5.0.0" maxversion="3.5.9.9">
122+
<migration class="PKP\migration\upgrade\v3_5_0\I10962_UpdateEmailTemplateVariables"/>
123+
</upgrade>
124+
120125
<upgrade minversion="3.1.0.0" maxversion="3.4.9.9">
121126
<migration class="PKP\migration\upgrade\v3_5_0\PreflightCheckMigration" fallback="3.4.9.9" />
122127
<migration class="APP\migration\upgrade\v3_5_0\I8333_AddMissingForeignKeys" />
@@ -163,6 +168,7 @@
163168
<migration class="PKP\migration\upgrade\v3_5_0\I11238_PrepareDBForStructuredCitations"/>
164169
<migration class="APP\migration\upgrade\v3_5_0\I11241_MissingDecisionConstantsUpdate"/>
165170
<migration class="APP\migration\upgrade\v3_5_0\I11125_UpdateEmailTemplateVariables"/>
171+
<migration class="PKP\migration\upgrade\v3_5_0\I10962_UpdateEmailTemplateVariables"/>
166172
<code function="downloadIPGeoDB"/>
167173
<note file="docs/release-notes/README-3.5.0" />
168174
</upgrade>

0 commit comments

Comments
 (0)