AttributeError: 'Environment' object has no attribute 'get_db_cnx'
  
  
  
    
    
    
      
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.
     
   
 
          
    
        
          
          Change History (6)
          
              
              
              
                
  
  
    
      
    
    
      
        | Owner: | changed from Rob Guttman to Ryan J Ollos | 
        | Status: | new →
            accepted | 
    
   
               
              
                
  
  
    
      
    
    
      
        | Resolution: | → fixed | 
        | Status: | accepted →
            closed | 
    
   
    
               
              
                
  
  
    
      
    
    
      
        | Owner: | changed from Ryan J Ollos to Justin Ludwig | 
    
   
               
              
                
  
  
    
      
    
    
      
        | Summary: | error saving changes with trac 1.2 →
            AttributeError: 'Environment' object has no attribute 'get_db_cnx' | 
    
   
               
           
         
      
      
     
    
The attached
ticket12934-2016-11-07.patchcontains a fix for this, replacing the oldenv.get_db_cnxAPI with the newenv.db_transactionAPI.