Modify

Opened 7 years ago

Closed 18 months ago

#2042 closed enhancement (wontfix)

priority/milestone/component/version get repeated twice for users without TICKET_ADMIN permissions

Reported by: thomasvs Owned by: coderanger
Priority: normal Component: CondFieldsPlugin
Severity: normal Keywords: fixed condfields null
Cc: Trac Release: 0.10

Description

I'm not sure how to narrow this down in the code. I had one user complain that he saw these four fields twice, and hence Trac was giving a traceback when trying to submit:

Traceback (most recent call last):
  File "/usr/lib/python2.4/site-packages/trac/web/main.py", line 387, in dispatch_request
    dispatcher.dispatch(req)
  File "/usr/lib/python2.4/site-packages/trac/web/main.py", line 237, in dispatch
    resp = chosen_handler.process_request(req)
  File "/usr/lib/python2.4/site-packages/trac/ticket/web_ui.py", line 279, in process_request
    self._do_save(req, db, ticket)
  File "/usr/lib/python2.4/site-packages/trac/ticket/web_ui.py", line 506, in _do_save
    ticket.populate(req.args)
  File "/usr/lib/python2.4/site-packages/trac/ticket/model.py", line 124, in populate
    self[name] = values.get(name, '')
  File "/usr/lib/python2.4/site-packages/trac/ticket/model.py", line 117, in __setitem__
    value = value.strip()
AttributeError: 'list' object has no attribute 'strip'

Looks like usually a form value goes into a string, and now because there are duplicates it went into a list of str

The problem went away when giving the user TRAC_ADMIN or TICKET_ADMIN, but not with any of the other TICKET_* permissions.

What more info would you want to be able to diagnose this ?

Attachments (4)

Screenshot.png (28.0 KB) - added by thomasvs 7 years ago.
condfields_ticket_2042.patch (747 bytes) - added by sto 7 years ago.
condfields_ticket_2042.2.patch (749 bytes) - added by sto 7 years ago.
condfields.cs (4.2 KB) - added by anonymous 7 years ago.

Download all attachments as: .zip

Change History (12)

Changed 7 years ago by thomasvs

comment:1 Changed 7 years ago by thomasvs

some further notes:

  • with "view source", you don't see the duplicate fields
  • firebug does show HTML code for the duplicate fields
  • I assume that the plugin's code is rewriting the HTML object model using javascript on the fly

comment:2 Changed 7 years ago by steve@…

I have 30+ users on nearly identical setups and two of them have this problem. Stepping through the JS in Firebug I can see the duplication occurring but cannot see why those fields are treated differently on only those two machines 100% of the time.

This is a Firefox-only problem so the work-around is just to use IE, but this is far from ideal.

I would be more than happy to try any fixes suggested.

comment:3 Changed 7 years ago by sto

I've had the same problem and I've found that the bug is on the
condfields/templates/condfields.cs file.

The problem apperars when removing rows from the table from
javascript; the current code asumes that there are three valid rows
when changing properties, but that is not the case when the user can't
change the Description and Reported fields and it leaves original
fields and re-adds them.

I'm attaching a patch that solves the problem form me on
firefox. I don't have experience with javascript or
jQuery, so I'm unsure if it works on other browsers, but I
belive that the right fix must be close to mine.

Changed 7 years ago by sto

Changed 7 years ago by sto

Changed 7 years ago by anonymous

comment:4 Changed 7 years ago by anonymous

  • Keywords fixed condfields null added
  • Resolution set to fixed
  • Status changed from new to closed
  • Type changed from defect to enhancement

got 2 problems fixed: condfields is null and double shown fields.
condfields.cs ist fixed an runable version. Testet with firefox and IE6 (no more script errors!)

comment:5 Changed 7 years ago by anonymous

  • Resolution fixed deleted
  • Status changed from closed to reopened

Not actually fixed, leave it open or I will never see it.

comment:6 Changed 6 years ago by thomasvs

I did the same debugging today with Firebug and noticed the same problem as in comment 2.

I tried the attached condfields.cs and it did indeed fix the problem for me.

I must say that the .cs code is hard to follow, comments would have helped to understand that magic number of 3!

I would commit this change so this bug can be closed.

comment:7 Changed 6 years ago by anonymous

the patch condfields_ticket_2042.2.patch is mixing javascript and python. Change "and" in the if statement to "&&".

comment:8 Changed 18 months ago by rjollos

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

The 0.10 version of this plugin is no longer supported. If you can reproduce the issue with the 0.11 branch and Trac 0.11 or later, please create a new ticket and I will promptly fix the issue.

Add Comment

Modify Ticket

Action
as closed .
The resolution will be deleted. Next status will be 'reopened'.
Author


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

 
Note: See TracTickets for help on using tickets.