Problem/Motivation
Currently when deleting a digest the data from it (user subscriptions and timestamps) is un touched. This info should be removed.
Also, when updating the schedule to a digest, the timestamp will need to be updated.
Steps to reproduce
Create a digest and have it create a timestamp. Or have a user subscribe to the digest.
Then delete the digest. The data will still be on the site.
Proposed resolution
Override the delete function of the digest to delete all user subscriptions for it and the timestamp.
Add an extra boolean parameter to the set 'send_at' function of the digest that defaults to true.
If this is true, call the 'setNextSendDate' function.
| Comment | File | Size | Author |
|---|---|---|---|
| #6 | 3166226-6.patch | 4.82 KB | derekcresswell |
Comments
Comment #2
derekcresswell commentedThis will be necessary to maintain a clean and consistent data structure. Slated for version 1.0.0.
Comment #3
derekcresswell commentedHere I've overridden delete function of the digest to remove subscriptions and state.
Comment #4
derekcresswell commentedAnd face palm, still needs to add the changing of timestamps when updating. Patch #3 only contains deletion.
Comment #5
derekcresswell commentedNow when updating digests schedules, there is the option to update the next send date as well.
Comment #6
derekcresswell commentedRemoved an excess line from the test that created a timestamp. That bit is internal so doesn't have it's place in the tests.
Comment #8
derekcresswell commentedSetting back to "Needs review".
Test failure is unrelated to this patch. Made a note of this (as it's appeared before) in issue 3166976.
Comment #9
joshmillerLooks good and reasonable to me.
Comment #11
derekcresswell commented