Edgewall Software
Modify

Opened 14 years ago

Closed 14 years ago

Last modified 14 years ago

#9002 closed defect (fixed)

[PATCH] Ticket owner always deleted when restrict_owner = true and only 1 user

Reported by: mrelbe <mikael@…> Owned by: Mikael Relbe
Priority: highest Milestone: 0.12
Component: ticket system Version: 0.11.6
Severity: normal Keywords:
Cc: Branch:
Release Notes:
API Changes:
Internal Changes:

Description

I've recently setup a Trac environment configured to restrict_owner=true. When only 1 user is registered, ticket owner is deleted upon changing ticket info.

Problem scenario:

  1. The environment is brand new, with me as the only user ever have been logged in.
  2. Create a new ticket, set myself as owner and save it.
  3. Edit the ticket (anything will do; just add a comment or change the state).

Along with the wanted ticket change, the owner becomes deleted.

Solution:

  1. Add another user to the Trac environment.
  2. Log in as that user.
  3. Log out and login as yourself.

Ticket-owner is now correctly handled when a ticket is changed.

Info: I am using AccountMgr plugin.

Attachments (2)

t9002_ticket-owner-deleted-r9516.patch (1005 bytes ) - added by Mikael Relbe 14 years ago.
#9002: Patch for 0.12dev-r9516 that solves the problem
t9002_resolution-fix-r9623.patch (1.6 KB ) - added by Mikael Relbe 14 years ago.
#9002: Patch for 0.12dev-r9623 solving similar problem for a singled resolution value

Download all attachments as: .zip

Change History (20)

comment:1 by mrelbe <mikael@…>, 14 years ago

The problem seems to arise when only one user has TICKET_MODIFY permission. "Owner" is always deleted when the single user who has TICKET_MODIFY permission makes any change to the ticket.

comment:2 by Christian Boos, 14 years ago

Keywords: needinfo added

You need to try to reproduce this without the TH:AccountManagerPlugin enabled, otherwise it's a PluginIssue.

in reply to:  2 comment:3 by mrelbe <mikael@…>, 14 years ago

Replying to cboos:

You need to try to reproduce this without the TH:AccountManagerPlugin enabled, otherwise it's a PluginIssue.

Understood, please give me some time before closing this ticket — I'm loaded at the moment.

comment:4 by Christian Boos, 14 years ago

The delay we use for needinfo tickets is 90 days, that gives you plenty of time ;-)

comment:5 by anonymous, 14 years ago

this is a test comment

comment:6 by Christian Boos, 14 years ago

… and this is not a test system, use the demo-0.12 for that, thanks.

in reply to:  2 comment:7 by mrelbe <mikael@…>, 14 years ago

Follow-up:

I have now tried to repeat the problem scenario using a clean installation of both Trac 0.11.6 and Trac 0.12dev [9212] with Genshi [G1093] as the only added extension.

There is definitely a problem with ticket owner when only a single user is ever logged in to a Trac environment having restrict_owner=true set:

  1. Install Genshi and one of Trac 0.11.6 or 0.12dev-r9212 (no database needed)
  2. Set restrict_owner=true in trac.ini, nothing else is changed
  3. Create a new environment accompanied by a htdigest password file with just one user
  4. Start Trac using tracd, provide the htdigest file and the environment
  5. Login as that user
  6. Create a ticket, set owner to the user being logged in
  7. Browse to the ticket and change status from new to assignedthe ticket owner becomes deleted.

I wouldn't expect the ticket owner to be deleted at the final step above.

However, the original problem I reported about was that any change to a ticket would delete ticket owner. That does not hold to be true with this setup, so I'm guessing that TH:AccountManagerPlugin may have some problems too, or perhaps is a victim of a root cause to be found in Trac. (But I'll stop my analysing efforts here since I am not competent — yet — to make such conclusions.)

by Mikael Relbe, 14 years ago

#9002: Patch for 0.12dev-r9516 that solves the problem

comment:8 by Mikael Relbe, 14 years ago

Milestone: 0.12
Owner: set to Christian Boos
Priority: normalhighest
Summary: Ticket owner always deleted when restrict_owner = true and only 1 user[PATCH] Ticket owner always deleted when restrict_owner = true and only 1 user

The problem remains even in 0.12dev-r9615, i.e. also in 0.12b1.

The provided patch (t9002_ticket-owner-deleted-r9516.patch, typo error in the filename) applies to r9615 and solves the problem: Control output for ticket actions, that changes owner, is corrected for the case when "[ticket] restrict_owner = true" and only one owner exists. (No new owner were set in the action form for this case.)

Since this is a bug in 0.12b1, I suggest that this patch goes into 0.12. I would also like to ask Christian to verify this (or someone else in the core team, I selected you Christian, hope that's ok with you).

Last edited 14 years ago by Mikael Relbe (previous) (diff)

comment:9 by Mikael Relbe, 14 years ago

Argh… typo: The patch applies to r9615 and not 9516…

All these ticket and changeset numbers being so similar right now makes me dizzy :)

comment:10 by Remy Blank, 14 years ago

Owner: changed from Christian Boos to Mikael Relbe

Issue and fix verified, and patch committed (with a bit of reformatting) in [9621].

Looking at that section of code, it seems like the same issue is present for the resolution field, when only a single potential resolution is available. Could you please check if this is the case, and suggest a patch for that as well?

in reply to:  10 comment:11 by Mikael Relbe, 14 years ago

Replying to rblank:

Looking at that section of code, it seems like the same issue is present for the resolution field, when only a single potential resolution is available. Could you please check if this is the case, and suggest a patch for that as well?

I can confirm that. Why didn't I think of that? Answer: because I've recently spent the last three months of dedicated spare time to become a junior Trac-hacker (see date and last sentence of comment:7), the hard stuff has to wait some time more :)

Last edited 14 years ago by Mikael Relbe (previous) (diff)

by Mikael Relbe, 14 years ago

#9002: Patch for 0.12dev-r9623 solving similar problem for a singled resolution value

in reply to:  10 ; comment:12 by Mikael Relbe, 14 years ago

Replying to rblank:

/…/ and suggest a patch for that as well?

The patch t9002_resolution-fix-r9623.patch should take care of that.

comment:13 by Mikael Relbe, 14 years ago

Owner: changed from Mikael Relbe to Remy Blank

in reply to:  12 ; comment:14 by Remy Blank, 14 years ago

Replying to mrelbe:

The patch t9002_resolution-fix-r9623.patch should take care of that.

Looks good, thanks! I'll apply it tonight.

(About changing the owner: I assigned it to you so that you are credited for the work you have done once the ticket is closed. We don't (usually) change the owner to indicate that another person has to take an action.)

in reply to:  14 comment:15 by Mikael Relbe, 14 years ago

Owner: changed from Remy Blank to Mikael Relbe

Replying to rblank:

(About changing the owner: I assigned it to you so that you are credited for the work you have done once the ticket is closed. We don't (usually) change the owner to indicate that another person has to take an action.)

Noted, thanks for clarifying that.

comment:16 by Mikael Relbe, 14 years ago

Status: newassigned

comment:17 by Remy Blank, 14 years ago

Keywords: needinfo removed
Resolution: fixed
Status: assignedclosed

Perfect patch! Applied in [9628].

comment:18 by Mikael Relbe, 14 years ago

#8402 was closed as a duplicate to this

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The owner will remain Mikael Relbe.
The resolution will be deleted. Next status will be 'reopened'.
to The owner will be changed from Mikael Relbe 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.