Modify

Opened 6 years ago

Closed 4 years ago

Last modified 7 months ago

#12137 closed defect (fixed)

Trac 1.1.2 support: get_db_cnx() no longer available

Reported by: jouvin Owned by: Ryan J Ollos
Priority: normal Component: TagsPlugin
Severity: normal Keywords:
Cc: Trac Release:

Description

Hi,

I tried to update my 1.0.2 installation to 1.1.2, including the plugins I use with TracHacks among them. I got an error when trying to access a (upgraded) project complaining about the absence of a get_db_cnx() method.

A quick find in the sources of the plugins I use tended to show that most plugin continues to rely on get_db_cnx() to access the database, despite it has been declared obsolete a while ago and seems to have been removed in 1.1.x serie.

Any plan to move to the new transaction-based db access method?

Michel

Attachments (1)

tagsplugin-trac-1.1.4.patch (22.2 KB) - added by Robert W. Baumgartner 5 years ago.
Added patch for TagsPlugin (tested with Trac 1.1.4)

Download all attachments as: .zip

Change History (11)

comment:1 Changed 6 years ago by Steffen Hoffmann

This change has been hold back for continuing support of Trac 0.11 installations on Python2.4 and giving precedence to other developments.

After tags-0.8 release I'll move to the current Trac 1.0 db API immediately, skipping intermediate 0.12 db API. Did you already make an effort to patch locally? Patch proposals welcomed.

comment:2 Changed 6 years ago by jouvin

Not yet... but I'll let you know if I manage to find the time to look at it.

comment:3 in reply to:  2 Changed 6 years ago by Steffen Hoffmann

Replying to jouvin:

Not yet... but I'll let you know if I manage to find the time to look at it.

Would be great to get you assistance with this. It would help me a lot for review, if the first shot would be done by someone else.

Changed 5 years ago by Robert W. Baumgartner

Attachment: tagsplugin-trac-1.1.4.patch added

Added patch for TagsPlugin (tested with Trac 1.1.4)

comment:4 Changed 5 years ago by Robert W. Baumgartner

I've posted my own patch to get the TagsPlugin working under Trac v1.1.4

I really like this plugin, and am using it both in my lab and at work, so rather than wait it out I thought I'd take a few moments to contribute.

NOTE: The patch does not included updates to any of the tests (it's late where I am) and has only been tested briefly. If I end up making additional changes I'll try to post them here (unless there's a better place to put these, in which case hopefully someone can point me in the right direction). Thanks!

comment:5 Changed 5 years ago by Ryan J Ollos

The patch looks pretty good. When using the context manager it's not necessary to call db.commit() or db.rollback(), so some of the transaction blocks should be modified accordingly.

comment:6 Changed 5 years ago by Ryan J Ollos

In 14948:

0.9dev: Require Trac >= 1.0

Refs #12137

comment:7 Changed 4 years ago by Ryan J Ollos

Owner: changed from Steffen Hoffmann to Ryan J Ollos
Status: newaccepted

I'll commit changes to adapt to Trac 1.0 API. I implemented the changes pretty quickly, so I won't be surprised if there are issues that have not been exposed by the light testing I've done and existing unit test coverage. If you find any issues, please open a new ticket.

I appreciate any feedback on the changes, as positive feedback will lead to a quick release and greater confidence to deploy the changes to trac-hacks.org.

Last edited 4 years ago by Ryan J Ollos (previous) (diff)

comment:8 Changed 4 years ago by Ryan J Ollos

Resolution: fixed
Status: acceptedclosed

In 15559:

0.9dev: Adapt to Trac 1.0 database API

All tests are passing with SQLite, PostgreSQL and MySQL.

Fixes #12137.

comment:9 Changed 4 years ago by Ryan J Ollos

In 16059:

0.9dev: Remove use of macros.html

The template include was not needed, and macros.html
is not available in Trac >= 1.2.

Refs #12137.

comment:10 Changed 7 months ago by Ryan J Ollos

In 17659:

TracTags 0.12dev: Use proper context manager

Patch by ealtmann.

Refs #12137, Fixes #13734.

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The owner will remain Ryan J Ollos.
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.