Edgewall Software
Modify

Opened 15 years ago

Closed 15 years ago

#8817 closed defect (fixed)

Milestone insert() method is not updating _old_name member

Reported by: Andrea Tomasini <andrea.tomasini@…> Owned by: Remy Blank
Priority: normal Milestone: 0.11.6
Component: general Version: none
Severity: normal Keywords: milestone, update, insert
Cc: support@… Branch:
Release Notes:
API Changes:
Internal Changes:

Description

The current Milestone insert() method is not updating the _old_name member, therefore it is not possible to create and update a milestone without closing it and reopening it. I understand that is not vital to trac, as apparently the creation and the updates are done in different requests, but is an error in the model integrity.

The patch is deadly simple:

Index: trac/ticket/model.py
===================================================================
--- trac/ticket/model.py	(revision 8744)
+++ trac/ticket/model.py	(working copy)
@@ -693,7 +693,8 @@
                       "VALUES (%s,%s,%s,%s)",
                       (self.name, to_timestamp(self.due), to_timestamp(self.completed),
                        self.description))
-
+        self._old_name = self.name
+        
        if handle_ta:
            db.commit()
        TicketSystem(self.env).reset_ticket_fields()

Attachments (0)

Change History (2)

comment:1 by Remy Blank, 15 years ago

Milestone: 0.11.6
Owner: set to Remy Blank

I'll do that later tonight.

comment:2 by Remy Blank, 15 years ago

Resolution: fixed
Status: newclosed

Actually, not only milestones, but also components and versions exhibited the same issue. I have added test cases for this use case and fixed the issue in [8811].

Thanks for the bug report and the solution!

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The owner will remain Remy Blank.
The resolution will be deleted. Next status will be 'reopened'.
to The owner will be changed from Remy Blank to the specified user.

Add Comment


E-mail address and name can be saved in the Preferences .
 
Note: See TracTickets for help on using tickets.