Modify ↓
      
        Opened 11 years ago
Closed 9 years ago
#12099 closed defect (fixed)
Not compatible with Trac 1.1.2
| Reported by: | Owned by: | Ryan J Ollos | |
|---|---|---|---|
| Priority: | normal | Component: | WorkLogPlugin | 
| Severity: | normal | Keywords: | |
| Cc: | Ryan J Ollos | Trac Release: | 1.2 | 
Description
Because get_db_cnx is no longer supported on Trac 1.1.2 (see http://trac.edgewall.org/wiki/TracDev/DatabaseApi), plugin does not work on 1.1.2. It fails environment upgrade, so nothing works then.
Attachments (3)
Change History (8)
comment:1 Changed 11 years ago by
comment:2 Changed 11 years ago by
| Owner: | changed from Colin Guthrie to Ryan J Ollos | 
|---|---|
| Status: | new → accepted | 
comment:3 Changed 11 years ago by
For future reference, please consider providing a patch as opposed to edited files: trac:TracDev/SubmittingPatches.
Note: See
        TracTickets for help on using
        tickets.
    



I'm not Python programmer, but I tried to fix it for my own. Files with outdated call are api.py, manager.py and timeline.py. In most cases only SELECT SQL statements are used, in this case I exchanged old
get_db_cnxcall withget_read_dbcall. This fixes for example upgrade of the environment.In start_work and stop_work of manager.py, INSERT statement is used. In this case I exchanged old
get_db_cnxwithwith self.env.db_transaction as db:statement, intended appropriate lines and removeddb.commitcall. Files are attached.Such a way, it seems the plugin works again. But I do not know much about Python and Trac structure, so please check it.