OJS 3.2.1.1 - Email templates were restored to default

Hi!

A few weeks ago, we noticed that automatic reminders were not being sent. This had happened before and our tech team fixed it as usual (by activating cron).

Turns out, ever since they did that, the email templates were all restored to the out-of-the-box-default and the any changes the journals made were lost. Is there some way to restore those email templates?

There is another problem, which is, when they try to alter the templates, it saves as it should (meaning no error messages) but the changes are completely ignored by the system. This happens on and off. Sometimes the changes will “stick” and sometimes they won’t.

Thanks in advance!

Hi,
If you have access to your database, custom emails are stored in a separate email_templates_settings table. If this table is empty (and the email_templates is empty too), then someone has (probably accidentally) reset the templates to default. If that is the case, restoring those custom templates is not possible unless 1° The system administrator has made backups of the db or 2° they were deleted very recently, in which case it might still be retrievable with the appropriate software.

As for the second problem, what does the error log say?

Hello @pheckler, how are you? I checked those tables and both have a lot of information. The templates weren’t reseted. In the first table I got more than 21000 rows and the second I found 2522 rows.

Hi!
That sounds like a LOT of data, especially for the email_templates table. If I understand the source code on this point, it essentially means that you have custom emails for well over 300 journals, is that correct? If it is and if all these rows match the templates that you were looking for (the content of the templates will be in email_templates_settings), then at least you still have the text. If none of them load to the backend, there is an error somewhere which should appear in the log.

Hi @pheckler,
That’s true, there is a lot of information and maybe the customized templates are there. I generated I file with all rows and @alexxxmendonca realized the number of rows with Portuguese is low than should be. I search for error in apache logs and I didn’t find something about this inconsistency.
This inconsistency appears between two situations: We upgraded to the last version 3.2.1.1 a month ago and enable scheduled_tasks. Is there another thing we can check?
Best Regards,

Hi!

It should be all there is. Did you have any problem during the upgrade? @Carolina_Tanigushi mentioned a problem when trying to edit templates. This should generate an error either in the log or in the browser inspector that might help to locate the issue (the two are most likely correlated).

Hi @pheckler

I tried it again and still couldn’t replicate.The person who first let us know she was having trouble with saving has also been able to successfully alter the email templates so it seems like this was either a temporary instability or something with the internet connection.

Edit: the issue with saving the templates, that is. The problem with the email templates being restored to default still hasn’t been solved.

Hi,

That is good for your workflow at least!
As for the templates, does disabling schedule tasks have any effect on the bug?

Hi, @pheckler

We were able to solve the problem by retrieving and restoring the email template tables from an earlier point, though we still haven’t been able to find out what caused this problem in the first place.

Thank you for all the help!

1 Like

Hello friends,

In our installation (3.2.1.1) the custom email templates were deleted 2 times already.
Verifying in the email_templates_settings table were deleted all the templates settings from 3 languages (es_ES, pt_BR and en_US) for ALL the journals.

We couldn’t identify the reason for this losses. Even after removing the button that can be used to restore all the templates from the options (we had thought that button were the responsible for the deletion).

Have you identify this? is it fixed in next versions?

Thanks in advance people,

Hello, everyone!

We had this problem one more time and we believe the action that triggered the all round restore was a user that restored the “review_cancel” e-mail template. The email templates for all the journals in our installation have been restored to default.

We believe this due to the timing of these two incidents (there’s 6 minutes difference between the time that this action was performed and the first email we got saying that the email templates had been restored to default) and there (seemingly) weren’t any other actions that could have caused this. The log for this action is:

000.000.0.000 - - [09/Apr/2021:14:40:46 -0300] “DELETE /index.php/xxxx/api/v1/emailTemplates/REVIEW_CANCEL HTTP/1.1” 000 0000 “https://submission.scielo.br/index.php/xxxx/management/settings/workflow” “Mozilla/5.0 (Macintosh; Intel Mac OS X 11_2_3) AppleWebKit/000.00 (KHTML, like Gecko) Chrome/89.0.4389.114 Safari/000.00”

We were, however, not able to reproduce this in our staging environment, maybe due to a OS difference? The user that performed the original action was on a Mac (Macintosh; Intel Mac OS X 11_2_3) and I’m running Windows (Windows NT 10.0; Win64; x64).

Testing the “Restore template” option gave me the expected results (restored that specific template and only for that journal) and not even when proxying in their account I could reproduce the problem. I also tested the “Restore all templates” action and it still worked as it should.

Could there be another action we should look for? Our IT team says there weren’t any logs for actions performed directly in the database so it was definitely something a user accidentally did (and not a installation admin but a manager editor as it wasn’t anyone in SciELO).

We did notice, however, that there seems to be an error in this specific journal (Cannot convert blob:xxxxxxxxxxxxxxx to Blob. Resource might not exist or is inaccessible) that doesn’t exist in other journals in our installation. Could this be what’s causing the problem? The error also appears badly formatted:

Captura de tela 2021-04-14 120853

(PS: there’s also a possibility that it was the same journal site that caused this the first time it happened, so could it be a problem with this specific journal in our installation?)

Hi @Carolina_Tanigushi,

The Cannot convert blob message is coming from TinyMCE, and it’ll be unrelated to the email reset problem.

How did the user restore the review_cancel email template?

Regards,
Alec Smecher
Public Knowledge Project Team

Hi, @asmecher. Thank you for getting back to me.

Eventually they got back to us saying they couldn’t track who performed the action as there was no one that they know of on a Mac. The action apparently was the “disable” option, according to the tests we ran.

Hi @Carolina_Tanigushi,

Do you mean the “Disable” button for a particular email template in Settings > Workflow > Emails > Email Templates? Or something else?

Regards,
Alec Smecher
Public Knowledge Project Team

Sorry, @asmecher. Yes, that’s what I meant.

Thanks!

Hi @Carolina_Tanigushi,

I’ve experimented locally with enabling/disabling email templates and can’t see any unwanted behaviour – were you able to replicate the behaviour using that feature on your side?

Regards,
Alec Smecher
Public Knowledge Project Team

Hi, @asmecher

I haven’t really been able to replicate it either. It’s either something that “exists” in production that doesn’t in our testing instance or the OS difference (or something else entirely, but we couldn’t find any other actions that could’ve caused this when looking at the log).

Thanks!

Hi @Carolina_Tanigushi,

Unfortuantely I think this is something you’ll have to track down on that system – I think it may be unique to the environment. We don’t have enough information to investigate further on this end and I haven’t been able to replicate the problem.

Regards,
Alec Smecher
Public Knowledge Project Team

Hi @asmecher,

No worries. Thank you for taking the time to look into this either way!