Opened 3 years ago

Closed 3 years ago

# Deleting hours when deleting a ticket

Reported by: Owned by: j43l1us@… rjollos normal TracHoursPlugin major deleting 0.12

### Description

Hi everybody,
I'm running TracHoursPlugin 0.6.0dev-r12205 on a TRAC 0.12.3 server and I noticed that the hours allocated to a ticket aren't deleted when I'm deleting this ticket...
Is there an update that fixes the problem ?

Thank you in advance for you answer, have a good day

### comment:1 follow-up: ↓ 2 Changed 3 years ago by rjollos

• Status changed from new to assigned

I haven't tried to reproduce yet, but I think it will be a fairly easy issue to solve. It looks like we just need to delete the hours in ITicketChangeListener.ticket_deleted. In fact, the body of that method reads # TODO delete hours for this ticket.

### comment:2 in reply to: ↑ 1 Changed 3 years ago by anonymous

I haven't tried to reproduce yet, but I think it will be a fairly easy issue to solve. It looks like we just need to delete the hours in ITicketChangeListener.ticket_deleted. In fact, the body of that method reads # TODO delete hours for this ticket.

Thanks you for the answer ! I'll wait for that modification.
Have a nice day

### comment:3 Changed 3 years ago by rjollos

(In [13199]) Refs #11092: Populate and destroy the database on each test run. Adjusted test cases to account for ticket-custom field having been created in setUp by the call to upgrade_environment.

### comment:4 Changed 3 years ago by rjollos

(In [13206]) Refs #11092:

• Implemented delete_ticket_hours.
• Call delete_ticket_hours in ITicketChangeListener.ticket_deleted implementation.
• Fixed error in test_add_ticket_hours. The id column of the database was being confused with ticket.id, however the ticket id value is stored in the ticket column.

Note: Plugin version is 0.6.0dev and API is subject to change before the 0.6.0 release.

### comment:5 Changed 3 years ago by rjollos

(In [13207])

Refs #11092: Moved method _revert_trachours_schema_init to shared function revert_trachours_schema_init in __init__.py.

### comment:6 follow-up: ↓ 7 Changed 3 years ago by rjollos

• Resolution set to fixed
• Status changed from assigned to closed

The issue should be resolved now. Please let me know if you encounter any issues.

### comment:7 in reply to: ↑ 6 ; follow-up: ↓ 8 Changed 3 years ago by anonymous

• Resolution fixed deleted
• Status changed from closed to reopened

The issue should be resolved now. Please let me know if you encounter any issues.

Thank you for resolving this sir ! Hours are deleted when I delete the ticket, works fine!

I tested your modifications by reinstalling the plugin :

easy_install https://trac-hacks.org/svn/trachoursplugin/trunk/


But, I've got another problem now : TicketSidebarProviderPlugin is not showing so I can't add hours to a ticket...

### comment:8 in reply to: ↑ 7 ; follow-up: ↓ 9 Changed 3 years ago by j43l1us@…

Sorry, bad formatting... Anonymous was me

The issue should be resolved now. Please let me know if you encounter any issues.

Thank you for resolving this sir ! Hours are deleted when I delete the ticket, works fine !
I tested your modifications by reinstalling the plugin :

easy_install https://trac-hacks.org/svn/trachoursplugin/trunk/


But, I've got another problem now : TicketSidebarProviderPlugin is not showing so I can't add hours to a ticket...

### comment:9 in reply to: ↑ 8 Changed 3 years ago by j43l1us@…

• Resolution set to fixed
• Status changed from reopened to closed

Sorry, bad formatting... Anonymous was me

The issue should be resolved now. Please let me know if you encounter any issues.

Thank you for resolving this sir ! Hours are deleted when I delete the ticket, works fine !
I tested your modifications by reinstalling the plugin :

easy_install https://trac-hacks.org/svn/trachoursplugin/trunk/


But, I've got another problem now : TicketSidebarProviderPlugin is not showing so I can't add hours to a ticket...

Damn, i'm a noob. My excuses... I tried to reinstall TicketSidebarProviderPlugin with easy_install... And the plugin is now visible !

Thanks a lot for your help sir !