Modify

Opened 7 years ago

Last modified 2 years ago

#2634 assigned defect

Does not work for 'new' tickets

Reported by: goldman Owned by: gt4329b
Priority: lowest Component: FlexibleAssignToPlugin
Severity: major Keywords:
Cc: Trac Release: 0.12

Description

Dropdown shows up when reassigning, but not for new tickets. Config issue perhaps?

Attachments (1)

ticket.html.newTicketOwnerToSelf.dev013-r10672.patch (1.4 KB) - added by gt4329b 3 years ago.
Patch against trunk 0.13 r10672 to default new tickets to the creating (and assumed logged in) user

Download all attachments as: .zip

Change History (11)

comment:1 follow-up: Changed 7 years ago by gt4329b

  • Priority changed from normal to high
  • Status changed from new to assigned

Minor point of clarification: you're not actually trying to use FlexibleAssignTo with Trac 0.10.*, are you? I'm figuring that was just a ticket-entry oversight, but I want to be sure...

As far as the dropdown not showing up on new tickets: you're absolutely right. I hadn't noticed that until now as our Trac has been tweaked to short-circuit the "owner" field on the new ticket page to default to the currently logged-in user, as well as be non-editable. Because of that implementation tweak, made before FlexibleAssignTo was implemented, I never realized that FlexibleAssignTo doesn't work on the new ticket page. Although I'm not surprised it doesn't, given the way the template matching & code slipstreaming is written.

I'll take a look and see what can be done -- at the very least I can point you to the relevant section of code if you want to tackle it on your own.

comment:2 Changed 7 years ago by goldman

  • Trac Release changed from 0.10 to 0.11

Trac 0.11b1 here, sorry for the wrong info in initial submission. I wonder whether some sort of workflow hack could force Trac to execute set_owner operation on new tickets?

comment:3 follow-up: Changed 6 years ago by Melanor9@…

  • Severity changed from normal to major

comment:4 in reply to: ↑ 3 Changed 5 years ago by anonymous

Any news on this? Cheers

comment:5 in reply to: ↑ 1 ; follow-up: Changed 4 years ago by jimbeau

Replying to gt4329b:


I'll take a look and see what can be done -- at the very least I can point you to the relevant section of code if you want to tackle it on your own.

Any news on this?

If you just point me to the code, I can see what can be done.

jimbeau

comment:6 Changed 4 years ago by suran.jan@…

Hello i have this problem too.
My version of trac is 0.11.4 is there any solution ?

comment:7 in reply to: ↑ 5 Changed 4 years ago by anonymous

Replying to jimbeau:

Replying to gt4329b:


I'll take a look and see what can be done -- at the very least I can point you to the relevant section of code if you want to tackle it on your own.

Any news on this?

If you just point me to the code, I can see what can be done.

jimbeau

You may set restrict_owner = true in your trac.ini but it will show only the 'cryptic' names in the initial assign-to (in new tickets) as without this plugin.

IMHO there is no way in 0.11 to fix the initial assign-field to show up in the same beautiness as in the re-assign-field as done by this plugin.
You will be able to set option values but no option display values for the select-field ('assign to'-field in new tickets).
Have a look in the method post_process_request() in flexibleassignto.py, add something like this to understand what I mean:

    def post_process_request(self, req, template, data, content_type):
        if not data or len(self.valid_owner_controllers) == 0:
            return template, data, content_type
        
        if 'fields' in data:
            fooFields = data.get('fields',[])
            for k in range(len(fooFields)):
                if (fooFields[k]['name'] == 'owner'):
                    fooOwner = fooFields[k]
                    fooOwner['type'] = 'select'
                    # no way here to set the display value?!
                    fooOwner['options'] = {'Foo', 'Bar', 'Baz'}

Maybe I am missing something and there is a proper solution, I have overseen.
Let me/us know.

Dispite the fine work of gt4329b for this plugin there also is a patch for 0.11 which may be suitable for you http://trac.edgewall.org/ticket/7339.

HTH!
regards, Marian

Changed 3 years ago by gt4329b

Patch against trunk 0.13 r10672 to default new tickets to the creating (and assumed logged in) user

comment:8 follow-up: Changed 3 years ago by gt4329b

  • Priority changed from high to lowest

Probably not going to get around to ever tackling this, as my company's use case is just to default new tickets to the ticket creator. Sorry :/

In case that use case works for you, the attached patch can be used to monkeypatch your (0.13dev-r10672 or later) ticket.html code to default to the current user - which is really only useful if only logged-in users can create tickets.

I'll leave this ticket open as I suspect that there might one day be other people who run into the same thing and think it's a new/unknown bug...

comment:9 in reply to: ↑ 8 Changed 3 years ago by mizraith

Replying to gt4329b:

I'll leave this ticket open as I suspect that there might one day be other people who run into the same thing and think it's a new/unknown bug...

Thank you for leaving it open! I actually just spent a day thinking that I had my installation incorrect for the FlexibleAssignTo plugin. I'm glad I came across this ticket, actually. I have the plugin working, I just had not fully created a ticket and checked the ticket to reassign to a new owner.

comment:10 Changed 2 years ago by anonymous

  • Trac Release changed from 0.11 to 0.12

using trac 0.12.4 plugin work only when modify ticket, but when i create a new ticket - there are only user logins at owner list, not full names

Add Comment

Modify Ticket

Action
as assigned .
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.