Modify

Opened 2 years ago

Closed 2 years ago

#9953 closed defect (fixed)

Changing a testcase custom field value gives and error

Reported by: vnemes Owned by: seccanj
Priority: normal Component: TestManagerForTracPlugin
Severity: normal Keywords:
Cc: Trac Release: 0.12

Description

Hello,
Every time I try to modify the value of a custom field, I get a popup with the following error message:

An error occurred performing the operation.

Please try again. 

The thing is, if I reload the page, the change is done and it appears in the changes history, despite the error message.

If i put a breakpoint with Firebug in testmanager.js/doAjaxCall() that is called from testmanager.js/sendUpdate() and look at the return value, it is:

"<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> </html>"

The expected value should be "OK", otherwise an error is generated

The trac log shows the following:

2012-04-10 17:55:41,707 Trac[model] DEBUG: Provider for realm testcase is <testmanager.model.TestManagerModelProvider object at 0x02DFE5B0>
2012-04-10 17:55:41,707 Trac[model] DEBUG: Object key is {u'id': u'8'}
2012-04-10 17:55:41,707 Trac[model] DEBUG: >>> create_instance - testcase {u'id': u'8'}
2012-04-10 17:55:41,707 Trac[model] DEBUG: Title: None
2012-04-10 17:55:41,707 Trac[model] DEBUG: Description: None
2012-04-10 17:55:41,707 Trac[model] DEBUG: >>> get_fields
2012-04-10 17:55:41,707 Trac[model] DEBUG: <<< get_fields
2012-04-10 17:55:41,709 Trac[model] DEBUG: >>> _fetch_object
2012-04-10 17:55:41,709 Trac[model] DEBUG: Searching for testcase: WHERE 1=1 AND id=%%s
2012-04-10 17:55:41,709 Trac[model] DEBUG: id = 8
2012-04-10 17:55:41,709 Trac[model] DEBUG: Object found.
2012-04-10 17:55:41,710 Trac[model] DEBUG: Title: testcase7
2012-04-10 17:55:41,710 Trac[model] DEBUG: <<< _fetch_object
2012-04-10 17:55:41,710 Trac[model] DEBUG: Exists: True
2012-04-10 17:55:41,710 Trac[model] DEBUG: {u'testcaseproperty1': u'Default value', u'testcaseproperty': u'Default value', 'page_name': u'TC_TT0_TT1_TC8', 'id': u'8'}
2012-04-10 17:55:41,710 Trac[model] DEBUG: <<< create_instance
2012-04-10 17:55:41,710 Trac[model] DEBUG: Value before: Default value
2012-04-10 17:55:41,710 Trac[model] DEBUG: Changing field value.
2012-04-10 17:55:41,710 Trac[model] DEBUG: Value after: modified
2012-04-10 17:55:41,710 Trac[model] DEBUG: >>> save_changes
2012-04-10 17:55:41,721 Trac[model] DEBUG: <<< save_changes

My environment is:
trac 0.12
mod_wsgi
python 2.7
tracgenericclass-1.1.2-py2.7.egg
tracgenericworkflow-1.0.3-py2.7.egg
testmanager-1.4.10-py2.7.egg

I have added this 2 custom testcase fields in trac.ini:

[testcase-tm_custom]
testcaseproperty = text
testcaseproperty.value = Default value
testcaseproperty1 = text
testcaseproperty1.value = Default value

I'm using Firefox 11 + Firebug

Attachments (1)

api.py (7.0 KB) - added by seccanj 2 years ago.
Patched tracgenericclass api.py

Download all attachments as: .zip

Change History (4)

Changed 2 years ago by seccanj

Patched tracgenericclass api.py

comment:1 Changed 2 years ago by seccanj

  • Status changed from new to assigned

You're right, I forgot to check-in the tracgenericclass part of the enhancement to show an error dialog in case an Ajax call fails.

Thanks for reporting this and for the problem determination :D

Before testmanager 1.4.11, which will contain this fix, comes out you can find the patched file in attachment.

Replace it into:
tracgenericclass/trunk/tracgenericclass/api.py

build and replace the TracGenericClass-1.1.2-py2.7.egg file under the Trac plugins directory.

Please, let me know if this fixes the bug and close this ticket :D

Ciao,
Roberto

comment:2 Changed 2 years ago by seccanj

Fixed with release 1.4.11.

comment:3 Changed 2 years ago by seccanj

  • Resolution set to fixed
  • Status changed from assigned to closed

Add Comment

Modify Ticket

Action
as closed .
as The resolution will be set. Next status will be 'closed'.
to The owner will be changed from seccanj. Next status will be '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.