Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Related TogglMapping not deleted when Redmine TimeEntry is deleted #30

Open
yelidrissi opened this issue Aug 10, 2018 · 4 comments
Open
Assignees
Labels
bug Something isn't working
Milestone

Comments

@yelidrissi
Copy link

If you import an item from Toggl. Then delete the item in redmine, then import again. The second import produces two messages. One saying it succeeded the other saying the import failed.

@jigarius jigarius changed the title Francois Bug #3 Related TogglTimeEntry not deleted when Redmine TimeEntry is deleted Aug 11, 2018
@jigarius
Copy link
Owner

I was looking for a "onModelDelete" kind of a hook so that I could delete the mapping between the Toggl time entry and the Redmine time entry when a Redmine time entry is deleted. If it is not possible to do this with a delete hook, I might have to resort to cron for cleaning dangling entries from the toggl_time_entries table. This will need some research. For now, if you face this problem, you can log time for that entry manually.

@jigarius jigarius added the enhancement New feature or request label Aug 11, 2018
@jigarius jigarius added bug Something isn't working and removed enhancement New feature or request labels Oct 4, 2019
@jigarius jigarius changed the title Related TogglTimeEntry not deleted when Redmine TimeEntry is deleted Related TogglMapping not deleted when Redmine TimeEntry is deleted Oct 5, 2019
jigarius added a commit that referenced this issue Oct 5, 2019
When a TimeEntry is deleted, related TogglMapping records are also deleted.
@jigarius
Copy link
Owner

jigarius commented Oct 5, 2019

Patched Redmine's TimeEntry model to define a one to many relationship with TogglMapping. When a TimeEntry is deleted, the associated TogglMapping models are also deleted. Thus, a user can import entries from Toggl, then delete the imported entries from Redmine if required and then re-import those entries with corrections.

@jigarius jigarius closed this as completed Oct 5, 2019
jigarius added a commit that referenced this issue Dec 2, 2019
@jigarius
Copy link
Owner

jigarius commented Dec 4, 2019

When a time entry is imported, then deleted using the Redmine report table (at the top), it still appears as "imported" in the Toggl report table (at the bottom). To address this issue, we can refresh the Toggl report when a deletion takes place.

@jigarius jigarius reopened this Dec 4, 2019
@jigarius
Copy link
Owner

Now that we have tests in place, it will be fun to solve this problem for good 😃

@jigarius jigarius self-assigned this Jan 22, 2021
@jigarius jigarius added this to the v4.4.1 milestone Oct 17, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants