vanderbilt-redcap / email-alerts-module

Module to send customized emails alerts after a form/survey is completed to one or several recipients.
MIT License
3 stars 9 forks source link

Permanent Delete Button Does Not Work #17

Closed jasonlones closed 5 years ago

jasonlones commented 5 years ago

Delete Email Alert does not work when a user tries to 'Permanently Delete' an Email Alert.

v2.1.6 RC 8.10.8

knil-maloon commented 5 years ago

Hi @jasonlones I just tested it and it deleted the alert. 'Permanently delete' is also an admin functionality so regular users shouldn't see this. Can you tell me what type of project are you trying to delete this alert for? Is it longitudinal? Etc. Is there any error showing?

jasonlones commented 5 years ago

@knil-maloon It is not a longitudinal project. It has seven forms. Two are surveys. When clicking the button, nothing happens. I tried three browsers. Nothing else is particularly remarkable about these. They've been around for a while.

knil-maloon commented 5 years ago

@jasonlones I will check it out again to see if I can figure out what’s going on.

jasonlones commented 5 years ago

@knil-maloon, I found this error in the JS Console:

VM88:1 Uncaught SyntaxError: Unexpected token < in JSON at position 0 at Function.parse [as parseJSON] () at Object.success (functions.js?1553196972:549) at u (base.js:6) at Object.fireWith [as resolveWith] (base.js:6) at k (base.js:6) at XMLHttpRequest. (base.js:6)

jasonlones commented 5 years ago

@knil-maloon, I found this in the Network tab of Dev Tools:

Fatal error: Uncaught Error: Cannot unset string offsets in /var/www/html/redcap/modules/email_alerts_v2.1.6/deleteFormAdmin.php:119 Stack trace: #0 /var/www/html/redcap/redcap_v8.10.8/ExternalModules/index.php(102): require_once() #1 {main} thrown in /var/www/html/redcap/modules/email_alerts_v2.1.6/deleteFormAdmin.php on line 119 REDCap crashed due to an unexpected PHP fatal error!

Error message: Uncaught Error: Cannot unset string offsets in /var/www/html/redcap/modules/email_alerts_v2.1.6/deleteFormAdmin.php:119 Stack trace: #0 /var/www/html/redcap/redcap_v8.10.8/ExternalModules/index.php(102): require_once() #1 {main} thrown File: /var/www/html/redcap/modules/email_alerts_v2.1.6/deleteFormAdmin.php Line: 119

knil-maloon commented 5 years ago

Hi @jasonlones I tried to replicate the error without luck. For what I see in the error, it seems that the variable "email-records-sent", that registers the records already sent, has some sort of corruption or something is wrong as when it tries to unset it from the array it can't find the current position. Unfortunately we cannot justify working on this for the project that currently funds support for this module as it is a particular case.

jasonlones commented 5 years ago

@knil-maloon, no worries. I'm just reporting what I'm seeing. We won't be able to move to REDCap 9 right away so we have to make Email Alerts work as long as possible. Thanks!

knil-maloon commented 5 years ago

@jasonlones Thanks for letting us know :)