#9002 closed defect (fixed)
[PATCH] Ticket owner always deleted when restrict_owner = true and only 1 user
Reported by: | 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:
- The environment is brand new, with me as the only user ever have been logged in.
- Create a new ticket, set myself as owner and save it.
- 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:
- Add another user to the Trac environment.
- Log in as that user.
- 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)
Change History (20)
comment:1 by , 15 years ago
follow-ups: 3 7 comment:2 by , 15 years ago
Keywords: | needinfo added |
---|
You need to try to reproduce this without the TH:AccountManagerPlugin enabled, otherwise it's a PluginIssue.
comment:3 by , 15 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 , 15 years ago
The delay we use for needinfo tickets is 90 days, that gives you plenty of time ;-)
comment:7 by , 15 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:
- Install Genshi and one of Trac 0.11.6 or 0.12dev-r9212 (no database needed)
- Set
restrict_owner=true
in trac.ini, nothing else is changed - Create a new environment accompanied by a htdigest password file with just one user
- Start Trac using tracd, provide the htdigest file and the environment
- Login as that user
- Create a ticket, set owner to the user being logged in
- Browse to the ticket and change status from new to assigned — the 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 , 15 years ago
Attachment: | t9002_ticket-owner-deleted-r9516.patch added |
---|
#9002: Patch for 0.12dev-r9516 that solves the problem
comment:8 by , 15 years ago
Milestone: | → 0.12 |
---|---|
Owner: | set to |
Priority: | normal → highest |
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).
comment:9 by , 15 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 :)
follow-ups: 11 12 comment:10 by , 15 years ago
Owner: | changed from | to
---|
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?
comment:11 by , 15 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 :)
by , 15 years ago
Attachment: | t9002_resolution-fix-r9623.patch added |
---|
#9002: Patch for 0.12dev-r9623 solving similar problem for a singled resolution value
follow-up: 14 comment:12 by , 15 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 , 15 years ago
Owner: | changed from | to
---|
follow-up: 15 comment:14 by , 15 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.)
comment:15 by , 15 years ago
Owner: | changed from | to
---|
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 , 15 years ago
Status: | new → assigned |
---|
comment:17 by , 15 years ago
Keywords: | needinfo removed |
---|---|
Resolution: | → fixed |
Status: | assigned → closed |
Perfect patch! Applied in [9628].
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.