Hello friends,
I want to reopen the case open by @ [Carolina_Tanigushi] https://forum.pkp.sfu.ca/t/ojs-3-2-1-1-email-templates-were-restored-to-default
I have found the email templates in OJS 3.2.1-1 dissapear immediatly after enabling one language on Website Settings → Setup → Language in the column “Forms”, at that moment all the personalized templates in that language on email_templates_settings are deleted (from all journals in the installation).
If I find any solution I will post it here,
Thanks for your help
3 Likes
Hi @lcmartinezru (also @Carolina_Tanigushi ),
Thanks, those steps to reproduce the problem were the missing piece! I’ve filed this in Github and will look into a solution shortly.
opened 03:47PM - 01 Jun 21 UTC
From https://forum.pkp.sfu.ca/t/records-in-email-templates-settings-are-deleted-… when-enabling-forms-language-in-any-journal/68053 and https://forum.pkp.sfu.ca/t/ojs-3-2-1-1-email-templates-were-restored-to-default:
> I have found the email templates in OJS 3.2.1-1 dissapear immediatly after enabling one language on Website Settings → Setup → Language in the column “Forms”, at that moment all the personalized templates in that language on email_templates_settings are deleted (from all journals in the installation).
It appears that the email templates are removed when a locale is enabled (under "Forms" but probably elsewhere). This is happening due to...
1. [`LanguageGridHandler::saveLanguageSetting` calls `PKPContextService::restoreLocaleDefaults`](https://github.com/pkp/pkp-lib/blob/e6494e1b6c1798aa1d8e791e25f0df03a5733cef/controllers/grid/languages/LanguageGridHandler.inc.php#L86) (this call is context specific; see also [another similar call a few lines later](https://github.com/pkp/pkp-lib/blob/e6494e1b6c1798aa1d8e791e25f0df03a5733cef/controllers/grid/languages/LanguageGridHandler.inc.php#L94))
2. [`PKPContextService::restoreLocaleDefaults` then calls `PKPLocale::reloadLocale`](https://github.com/pkp/pkp-lib/blob/e6494e1b6c1798aa1d8e791e25f0df03a5733cef/classes/services/PKPContextService.inc.php#L556), which axes email templates _for all contexts_ (!)
Thanks,
Alec Smecher
Public Knowledge Project Team
2 Likes