TheRosettaFoundation / SOLAS-Match

Self-managed translation project interface
www.TheRosettaFoundation.org
GNU Lesser General Public License v3.0
12 stars 8 forks source link

This task seems to be corrupted and I can['t] delete it: http://trommons.org/task/15044/view/ #1232

Closed alanbarrett closed 8 years ago

alanbarrett commented 8 years ago

Alba submitted this: This task seems to be corrupted and I can['t] delete it: http://trommons.org/task/15044/view/ The Task has a status of "In Progress" but there is no "TaskClaims" entry.

This causes http://trommons.org/task/15044/org-feedback/ to give error: "Fatal error: Call to a member function getId() on a non-object"

If the Claim was deleted the "TRIGGER afterDeleteTaskClaim" should have changed Task status. Maybe a user was deleted, but I would assume this would trigger the trigger? SO I don't know why.

In any case I will fix the code to deal with this case so it does not crash... and allow a Task to be revoked (i.e. change the status) in this case.

Alan.
alanbarrett commented 8 years ago

Apparently it is a bug/feature of MySQL that a cascading delete will not trigger a trigger (i.e. deleting a User may delete a TaskClaims without the TRIGGER afterDeleteTaskClaim being triggered). However I have no reason to believe a User was deleted in this case.

Alan.
alanbarrett commented 8 years ago

I have fixed the crash issue if the "TaskClaims" entry is missing (for both user and org feedback pages). It also will be possible to revoke the task in these cases without causing a problem. Instead of the name of the user claiming the task (which is missing), there will be a message (or in the case of the revoke, a blank). Note a revoke message will still have to be entered, even though in one of the cases there will be nobody to send it to (and it will not be sent).

Here is the commit: https://github.com/TheRosettaFoundation/SOLAS-Match/commit/d8c6b62de011a9fdf9dedb9b0303fb3fd76384c7

Alan.