Subject: | Returning $r->prev->uri meaningless when taglib not used with PerForm |
I'm using AxKit::XSP::BasicAuth 0.01 (included in AxKit-XSP-BasicSession-0.16), on several Linux machines with perl versions ranging from 5.6.1 to 5.8.2. I am however, not using PerForm, and I guess that's what makes BasicAuth not behave as expected.
I call login in my XSP, and get
[Sun Dec 28 18:20:02 2003] [error] [client 127.0.0.1] [AxKit] [Error]
Can't call method "uri" on an undefined value at (eval 45) line 64.
In AxKit::XSP::BasicAuth, in parse_start on line 24, there is a line
return $r->prev->uri;}
...and this is the culprit.
Of course, when not using PerForm, there is no prev->uri, and this appears within xml_generator, and returning this URI from xml_generator is not what I would assume is meaningful anyway (?). Thus, the above error.
For me, the workaround is simply to comment out the above offending line, but I suppose that for PerForm users, this would break something, so it is not a fix.
Another workaround might be to just check if $r->prev exists, but I don't know if that's a real fix.
Perhaps one would have to check if PerForm is in use or not, or something?
I believe a minimal example to reproduce the bug is to just call login in a XSP script without PerForm, so I haven't done that, but if it isn't please contact me, I'll see what kind of example I can produce.
Cheers,
Kjetil