Item2014: Undefined subroutine CGI::remoteAddress
at lib/Foswiki/LoginManager/Session.pm
Priority: Normal
Current State: No Action Required
Released In: 1.0.7
Target Release: minor
Applies To: Engine
Component:
Branches:
Got this while installing Kino search. As its a subclass of
CGI::Session
(shipped with Foswiki) it looks like I need to replace
remoteAddress
with
remote_addr
.
Seems too simple a fix, and I don't have unit tests running, but the fix has been working for me so I will commit.
--
AndrewJones - 08 Sep 2009
Why did you do that exactly? I mean, we have:
remote_addr()
alias for compatibility with CGI.
KinoSearch is broken, I've never finished the porting work, and neither
did
WillNorris (who worked on it too iirc).
Why did you change the core to fix a plugin?
Gilmar would have to comment on it, but I think this has been named as
it is exactly to avoid using the CGI method, but ensure we're calling
the Foswiki::Request one.
Personaly, I would revert that and fix
KinoSearch.
--
OlivierRaginel - 08 Sep 2009
This change doesn't affect core, but, as Olivier pointed,
remote_addr
is provided for compatibility with CGI.pm, but core should use
remoteAddr
, that is aligned with foswiki naming convention.
Please, revert this and
fix/port KinoSearch appropriately. Notice that these changes make KinoSearch work only in CGI environment, otherwise it will probably fail.
--
GilmarSantosJr - 08 Sep 2009
Ok sorry about this, I will revert it. But looking through the code (and ignoring Kino),
Foswiki::LoginManager::Session
is only a small subclass for
CGI::Session
, right? And
CGI::Session
does not have the
remoteAddress
object, so I would have thought if it ever did try to call that object it would fail?
Probably I don't understand the code enough, so I will revert. But im still confused, so if you don't mind explaining it would be helpful for me. Its the only way I will learn
--
AndrewJones - 08 Sep 2009
Foswiki::LoginManager::Session
is a class to provide to foswiki the same functionality
CGI::Session
provides to CGI scripts, but it also works on environments other than CGI, cause it uses a
Foswiki::Request
objetc instead of environment variables to get data.
Since
CGI::Session
works well,
Foswiki::LoginManager::Session
is a thin layer over it, that adapts a few methods to make it work on environments other than CGI.
See more details at
FoswikiStandAlone.
--
GilmarSantosJr - 08 Sep 2009
Ok thanks Gilmar.
I have reverted the change so will close the task.
--
AndrewJones - 08 Sep 2009