Warning: Can't synchronize with repository "(default)" (Unsupported version control system "svn": No module named svn). Look in the Trac log for more information.

Ticket #402 (closed defect: fixed)

Opened 13 years ago

Last modified 12 years ago

std.url not behaving properly after a POST

Reported by: kevin Owned by: anonymous
Priority: normal Milestone: 0.9
Component: TurboGears Version:
Severity: normal Keywords: develix
Cc:

Description

From Rune Hansen on the mailing list:

std.url from todays svn checkout behaves differently from the one on friday:

<form action="${std.url('/Add')}" method="POST">
<input type="text" name="name" value=""/>
<input type="submit" name="submit" value="Add Source Group"/>
</form>

When loading this form for the first time the source reads:
 <FORM ACTION="/SiteGroup/Add" METHOD="POST">
.
.

After submitting the form on the url "localhost:10103/SiteGroup/Add" the source reads:
<FORM ACTION="/Add" METHOD="POST">

This is "different" from what I would expect, not saying that it is a bug :)


And,

SiteGroup is mounted on cherrypy.root.SiteGroup

controller.py contains identity code (which I hope will work again soon in svn):
class Root(..:
## identity.require(identity.in_group("admin"))
def index():
        raise cherrypy.HTTPRedirect("/SiteGroup/",302)

def login(...

server.webpath is not set

As long as std.url("/Add/") includes a trailing slash, it works as "expected"... assuming my expectations are justified.

And,

SiteGroup is a subclass of controllers.RootController
Add is a method of SiteGroup.

Given that SiteGroup? is a subclass of RootController?, url("/") on that add method should always point to SiteGroup?.

Change History

comment:1 Changed 13 years ago by kevin

  • Keywords develix added

comment:2 Changed 13 years ago by beza1e1@…

I think the problem is in turbogears.util.url here:

    if tgpath.startswith("/"):
        if cherrypy.request.app_path != "/": # could this fail somehow? app_path unset?
            tgpath = cherrypy.request.app_path + tgpath

Rune said i behaved differently before, but i can't access the Repository to diff util.py with it's older revision currently (problem is on my side, don't worry about the repository).

I can't track down this app_path. Where does it come from?

comment:3 Changed 13 years ago by anonymous

Ok, app_path is set in cherrypy._cphttptools.mapPathToObject, but only after  cherrypy rev926 (on 01/12/2006), which the cherrypy in TurboGears does not use. So app_path should never be set!? Why "not always" as in #423?

comment:4 Changed 13 years ago by kevin

This appears to be related (the same?) as #600.

comment:5 Changed 13 years ago by kevin

  • Status changed from new to closed
  • Resolution set to fixed

This should now be fixed in [823].

Note: See TracTickets for help on using tickets.