Modify

Opened 8 years ago

Closed 8 years ago

Last modified 8 years ago

#12934 closed defect (fixed)

AttributeError: 'Environment' object has no attribute 'get_db_cnx'

Reported by: Justin Ludwig Owned by: Justin Ludwig
Priority: normal Component: QueuesPlugin
Severity: normal Keywords:
Cc: Trac Release: 1.2

Description

When reordering items in a queue with Trac 1.2 and QueuesPlugin 0.2.0, xhr requests to the queuesajax/update handler return a 500 error with the following message:

Oops...
Traceback (most recent call last):
  File "build/bdist.linux-x86_64/egg/queues/web_ui.py", line 135, in process_request
    self._save_changes(changes, req.authname)
  File "build/bdist.linux-x86_64/egg/queues/web_ui.py", line 177, in _save_changes
    db = self.env.get_db_cnx()
AttributeError: 'Environment' object has no attribute 'get_db_cnx'

The same error is shown in a browser alert, and the page reloads without changes being saved.

Attachments (1)

ticket12934-2016-11-07.patch (2.6 KB) - added by Justin Ludwig 8 years ago.

Download all attachments as: .zip

Change History (6)

Changed 8 years ago by Justin Ludwig

comment:1 Changed 8 years ago by Justin Ludwig

The attached ticket12934-2016-11-07.patch contains a fix for this, replacing the old env.get_db_cnx API with the new env.db_transaction API.

comment:2 Changed 8 years ago by Ryan J Ollos

Owner: changed from Rob Guttman to Ryan J Ollos
Status: newaccepted

comment:3 Changed 8 years ago by Ryan J Ollos

Resolution: fixed
Status: acceptedclosed

In 15978:

1.2.0dev: Adapt to Trac 1.0+ database API

  • Create a new branch for Trac 1.2 and later.
  • Drop compatibility code for Trac < 1.2

Patch by justinludwig.

Fixes #12934.

comment:4 Changed 8 years ago by Ryan J Ollos

Owner: changed from Ryan J Ollos to Justin Ludwig

comment:5 Changed 8 years ago by Ryan J Ollos

Summary: error saving changes with trac 1.2AttributeError: 'Environment' object has no attribute 'get_db_cnx'

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The owner will remain Justin Ludwig.
The resolution will be deleted. Next status will be 'reopened'.

Add Comment


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

 
Note: See TracTickets for help on using tickets.