#4088 closed defect (worksforme)
webadmin links broken with latest trac svn
Reported by: | bobbens | Owned by: | Christopher Lenz |
---|---|---|---|
Priority: | normal | Milestone: | |
Component: | admin/web | Version: | devel |
Severity: | normal | Keywords: | |
Cc: | russ@… | Branch: | |
Release Notes: | |||
API Changes: | |||
Internal Changes: |
Description
Hello,
I've recently ugraded to Trac SVN (r4155) and have noticed that this breaks a few plugins like TracNav, TOCMacro and the WebAdmin plugin. It all seems to be in the links. I'm hosting several trac servers under the same host using http://host/server1 and have noticed that once I get into the webadmin the links point to http://host/admin instead of http://host/server1/admin like they used to. The first link in the bar points to it fine and other things like interwiki links, the timeline and svn browser work fine. I haven't touched my config and a trac-admin /var/env upgrade doesnt seem to need to upgrade anything. I can still use the webadmin but have to enter manually the paths, which is quite annoying.
Attachments (2)
Change History (19)
comment:1 by , 18 years ago
comment:2 by , 18 years ago
Note that you should remove the WebAdmin plugin, as this functionality is now part of Trac core.
Also, check the
[trac] base_url = ...
setting, which is now mandatory. That can explain this kind of weird behavior for links.
comment:3 by , 18 years ago
Cc: | added |
---|
If you dont mind my asking, what changed that base_url is now mandatory. I have like a hundred trac instances to update to make this work now.
Is there something I can put in the trac global ini that would make this work as it used to? (defaulting to the url that the rest of trac is using?)
comment:4 by , 18 years ago
I am having the same problem. Using revision 4438, and I have the baseURL set as well. No difference. Also, I should note that typing the address in manually works fine, except when I have to hit a submit button on a page, then the submit fails (ie: permissions page). This happened on a site I upgraded and on one where I did trac-admin ./ initenv.
follow-up: 7 comment:5 by , 18 years ago
anonymous,
do you have base_url (note the underscore) set and is it set to something that has the full web address of your trac (ie http://foo.bar.com/trac). I had no problems with trac working correctly after I set this attribute in the trac section of the trac.ini file.
russ
ps I will attach a file script I found useful for updating many tracs at once
by , 18 years ago
Attachment: | upgradeFrom10_1to10_3.py added |
---|
by , 18 years ago
Attachment: | upgradeFrom10_1to10_3.2.py added |
---|
comment:6 by , 18 years ago
I left my server name in the first one (which I am guessing will be harder to notice than your.server.here.com when they accidentally go to the url. You should use the second uploaded version.
Sorry, Russ
comment:7 by , 18 years ago
Replying to russ:
… do you have base_url (note the underscore) set and is it set to something that has the full web address of your trac (ie http://foo.bar.com/trac). I had no problems with trac working correctly after I set this attribute in the trac section of the trac.ini file. … ps I will attach a file script I found useful for updating many tracs at once
Wait, are you sure this is something that has changed since 0.10.1 to 0.10.3?
In the comment comment:2 above, I was talking about milestone:0.11. If this has also changed for milestone:0.10.3, we should document it in the release notes.
follow-up: 9 comment:8 by , 18 years ago
All my plugins that use self.env.href.Someword() stopped working (until I defined that key), after I upgraded to r4303 (based on info http://trac.edgewall.org/milestone/0.10.2). I was trying to debug some interaction between my plugin and that version of trac. In an attempt to fix the linking problems, I upgraded to trac head (r4441). I don't have a link handy but after your comment yesterday I found a couple other tickets talking about how this key had become mandatory.
Either way, my plugin would not generate links correctly without that key on revision r4441. (Not sure what milestone that is flagged for)
Hope this helps /sorry for the confusion,
Russ
comment:9 by , 18 years ago
Resolution: | → worksforme |
---|---|
Status: | new → closed |
Replying to russ:
… In an attempt to fix the linking problems, I upgraded to trac head (r4441) Either way, my plugin would not generate links correctly without that key on revision r4441. (Not sure what milestone that is flagged for)
Well, that's 0.11dev.
At any rate, avoid using self.env.href
when you have the req
(and therefore req.href
).
self.env.href
should only be used outside of the context of an user request, when you want to make use the "canonical" URL to access the Trac environment (e.g. when sending an e-mail notification).
Thanks for the patches, btw, I'm sure that can help other users having lots of Trac environments to update (even if they have less than hundreds!).
comment:10 by , 17 years ago
Milestone: | → 0.11 |
---|---|
Resolution: | worksforme |
Status: | closed → reopened |
it's not working, i can reproduce it with lighttpd 1.4.x + trac.fcgi, without trac.base_url set, what more info should i provide?
comment:11 by , 17 years ago
Keywords: | needinfo added |
---|---|
Milestone: | 0.11 |
- which version of Trac are you using?
- if trunk, are you still using the WebAdmin plugin by any chance? It must be uninstalled or at least disabled in the 0.11 environments.
Also, please don't schedule anything for 0.11, thanks.
comment:12 by , 17 years ago
Btw, if you're using a recent trunk, look for the following line in your log:
WARNING: TracWebAdmin plugin was used instead of Trac's builtin admin module. ...
follow-up: 14 comment:13 by , 17 years ago
Keywords: | needinfo removed |
---|
okay, here's the feedback:
TracWebAdmin package is required for most of the old admin plugins to be compatible with 0.11 admin. and yes, i can and should be disabled to enable 0.11 internal admin.
the test is done when base_url is empty
- when TracWebAdmin is enabled. result: admin links is broken
- when TracWebAdmin is installed but disabled. result: other admin links work but both iniadmin 0.10 and iniadmin 0.11 will do a wrong url redirect after submit. iniadmin 0.10 was working fine with trac 0.10, it would better not to break any plugins this way, not just iniadmin. and yes, i saw
WARNING: TracWebAdmin plugin was used instead of Trac's builtin admin module. ...
because some of my installe and enabled plugins try to import it. - when TracWebAdmin is NOT installed, almost same as 2, but the WARNING is gone, and iniadmin 0.10 no longer works (no iniadmin links in admin page), iniadmin 0.11 is the same as 2.
comment:14 by , 17 years ago
Replying to phpxcache@gmail.com:
okay, here's the feedback …
Thanks!
… when TracWebAdmin is installed but disabled. result: other admin links work but both iniadmin 0.10 and iniadmin 0.11 will do a wrong url redirect after submit.
Well, iniadmin 0.11 should work with 0.11. If not, that's an iniadmin issue.
iniadmin 0.10 was working fine with trac 0.10, it would better not to break any plugins this way, not just iniadmin.
Well, too many things changed from 0.10 to 0.11 so that can't ensure a out-of-the-box compatibility. At least some minimal porting work is expected.
I'll try to have a look at the specifics of the iniadmin problem, though.
comment:15 by , 17 years ago
Resolution: | → worksforme |
---|---|
Status: | reopened → closed |
Well, the following works for me:
- latest TH:IniAdminPlugin, [th 2259]
- latest Trac, r5817
- following
[components]
entries in the TracIni:iniadmin.iniadmin.iniadminplugin = enabled webadmin.* = disabled
As for the need of a base_url
setting, see also the recent discussion in googlegroups:trac-dev:af5abb087ad85d02
comment:16 by , 17 years ago
in iniadmin/iniadmin.py, i add a self.log.debug(self.env.href.admin(cat, page)) just before the redirect, it logs /admin/tracini/account-manager without auto detected base_url. tracnav "edit" link also due to the same reason (the broken env.href)
i'll leave this bug as close, but downgrading the auto detect ability and force ppl to set it in most case isn't nice.
comment:17 by , 17 years ago
Indeed, it should be:
-
iniadmin.py
38 38 if modified: 39 39 self.env.log.debug("Updating trac.ini") 40 40 self.env.config.save() 41 req.redirect( self.env.href.admin(cat, page))41 req.redirect(req.href.admin(cat, page)) 42 42 43 43 44 44 add_stylesheet(req, 'iniadmin/css/iniadmin.css')
Using env.href
without base_url
set is not supported anymore since r4086.
That being said, the discussion is not over, follow #5064 and the mail thread cited above.
I'm guessing it's http://trac.edgewall.org/ticket/3958 .