Closed emecas closed 7 years ago
I suspect that the reason is that you use Trac 1.2 where the database API is changed. I have not yet tested that. Can you please give me the exception message given with the stack trace?
Yes, you are right, that is the cause.
This is the exception message:
Oops…
Trac detected an internal error:
AttributeError: 'Environment' object has no attribute 'get_db_cnx'
This is similar to: https://trac-hacks.org/ticket/12934 , it has a patch already, replacing the old env.get_db_cnx
API with the new env.db_transaction
API.
Good. I'm aware of the patch and it is on my to-do list to integrate it now 1.2 is released. With a little luck next week...
Thanks.
This one looks a little more complicate than the one I just patched, what I'm no sure yet it's about backward compatibility.
There are 6 calls to the self.env.get_db_cnx()
statement in 2 the modules:
api.py (4 hits)
Line 72: self.upgrade_environment(self.env.get_db_cnx())
Line 147: db = self.env.get_db_cnx()
Line 174: db = self.env.get_db_cnx()
Line 185: db = self.env.get_db_cnx()
web_ui.py (2 hits)
Line 104: db = self.env.get_db_cnx()
Line 120: db = self.env.get_db_cnx()
Now my question is: would it be enough just by replacing the call logic for a with self.env.db_transaction as db:
block and in addition will it keep compatibility to previous versions?
If this is all we need to consider then I can help if you want it.
+1.
Good. I'm aware of the patch and it is on my to-do list to integrate it now 1.2 is released. With a little luck next week...
I've a patch working on Trac 1.0; hope to test it on 1.2 tomorrow or Wednesday and then commit to a new branch. Will appreciate if you'll try it out too, before I merge into master.
Re your question: That is exactly what I've done so far.
Sure, I can try it in ahead.
Can you please provide a link to the changeset/commit you want me to test.
Thanks!!
I'd be happy to help with review if you'd like to put it in a pull request.
Thanks both. Pull request created.
Getting the error message after installing trac-subtickets-plugin when click to open a ticket
Issue stops once the plugin is disable