Opened 8 years ago
Closed 8 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 8 years ago by
comment:2 Changed 8 years ago by
Summary: | Using deprecated databse API → Using deprecated database API |
---|
comment:5 follow-up: 7 Changed 8 years ago by
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 SELECT
s, otherwise use self.env.db_transaction
.
comment:6 Changed 8 years ago by
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 Changed 8 years ago by
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 useself.env.db_query
andself.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 8 years ago by
Resolution: | → fixed |
---|---|
Status: | accepted → closed |
In 16058: