Modify

Opened 7 years ago

Closed 7 years ago

#12980 closed defect (fixed)

Using deprecated database API

Reported by: anonymous Owned by: bebbo
Priority: normal Component: DirectoryAuthPlugin
Severity: normal Keywords:
Cc: Trac Release: 1.2

Description

Plugin use deprecated in TRAC 1.2 databаse API and don`t work on TRAC 1.2 installation. For example in auth.py

db = self.env.get_db_cnx()

Attachments (0)

Change History (8)

comment:1 Changed 7 years ago by Ryan J Ollos

In 16058:

2.0.2: Require Trac >= 1.0

Refs #12980.

comment:2 Changed 7 years ago by Ryan J Ollos

Summary: Using deprecated databse APIUsing deprecated database API

comment:3 Changed 7 years ago by bebbo

In 16068:

refs #12980

  • added support for the new db interface

refs #12823

  • added support for paged ldap queries using SimplePagedResultsControl

comment:4 Changed 7 years ago by bebbo

Status: newaccepted

please test the version 2.1.0-SNAPSHOT

comment:5 Changed 7 years ago by Ryan J Ollos

If you are aiming for Trac < 1.0 compatibility, you'll want to modify r16058. I don't bother with Trac < 1.0 anymore. If you are aiming for only Trac >= 1.0 compatibility, you can drop the complexity of _get_db and just use self.env.db_query and self.env.db_transaction everywhere, as described in trac:TracDev/DatabaseApi#Trac1.0API.

The general guidance is to use self.env.db_query if the statements contain only SELECTs, otherwise use self.env.db_transaction.

comment:6 Changed 7 years ago by Ryan J Ollos

Btw, thanks for picking up development of this plugin again! It definitely needs some care, and your contributions are valuable to the community. I don't have much experience with LDAP so I've never been able to help much with this plugin. Before it had a real maintainer I would try to fix things here and there, when the fix looked obvious. I hope to get up to speed on LDAP one of these days.

comment:7 in reply to:  5 Changed 7 years ago by bebbo

Replying to rjollos:

If you are aiming for Trac < 1.0 compatibility, you'll want to modify r16058. I don't bother with Trac < 1.0 anymore. If you are aiming for only Trac >= 1.0 compatibility, you can drop the complexity of _get_db and just use self.env.db_query and self.env.db_transaction everywhere, as described in trac:TracDev/DatabaseApi#Trac1.0API.

The requirement >= 1.0 is ok for me. I wanted to minimize the code changes, so I went for this way.

comment:8 Changed 7 years ago by bebbo

Resolution: fixed
Status: acceptedclosed

Modify Ticket

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