Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
issue: Activity Notice getLastRespondent()
This addresses issue 3647 where Internal Activity Alerts are never sent out for both Tasks and Tickets. Upon initial investigation it appeared that we set the `lastrespondent` property before we call `onResponse()`/`onActivity()` so when we checked the Last Respondent it was the same Agent posting the Reply so an email was never sent out. Upon moving the `lastrespondent` property below the `onResponse()`/`onActivity()` calls, it still grabbed the current Responding Agent. Looking deeper into `getLastRespondent()` (for both Ticket and Task classes) I found that the query we use to get the Last Response from an Agent on the Thread, grabs the newly added Response. This is because the Thread Entry is added before we call `getLastRespondent()` so we really need to grab the second record, not the first. This updates the `limit()` clause from `1` to `1,1` to utilize MySQL/MariaDB "LIMIT offest" so that we grab the second entry which is the true Last Response. This also moves the `lastrespondent` property below the `onResponse()`/`onActivity()` calls to ensure we don't return the current Responding Agent.
- Loading branch information