[Catalyst] missing 'use base' for ::Store?

Chisel Wright chisel at herlpacker.co.uk
Wed Nov 23 21:51:38 CET 2005


Decided to have a look at the new Store/State session plugins earlier. I
suspect there's a "use base qw/Catalyst::Plugin::Session/" missing from
either Catalyst::Plugin::Session::Store or
Catalyst::Plugin::Session::Store::CDBI

I put together a really small app, with one table (web_session) and a
default action which sticks a value in the session and displays the
(default) welcome page.

Running tests on it I was getting the following error:

  [Wed Nov 23 18:56:29 2005] [catalyst] [error] Caught exception in
  engine "Can't locate object method "sessionid" via package "App2" at
  /usr/lib/perl5/vendor_perl/5.8.7/Catalyst/Plugin/Session/State/Cookie.pm
  line 22."
  Use of uninitialized value in pattern match (m//) at
  /usr/lib/perl5/vendor_perl/5.8.7/HTTP/Request/AsCGI.pm line 156.
  Use of uninitialized value in concatenation (.) or string at
  /usr/lib/perl5/vendor_perl/5.8.7/HTTP/Request/AsCGI.pm line 157.

I dug around, and the sessionid method is provided by
Catalyst::Plugin::Session.
Catalyst::Plugin::Session::Store::CDBI uses
Catalyst::Plugin::Session::Store as a base class.

Catalyst::Plugin::Session::Store doesn't have any base classes (double
checked in trunk just now).

I solved the problem locally by adding

  use base qw/Catalyst::Plugin::Session/;

to Catalyst::Plugin::Session::Store. Is this the correct fix? If so,
could someone do the honours please?


I'd also like to submit a pod-patch for
Catalyst::Plugin::Session::Store::CDBI in the next day or two, as I feel
it could really benefit from an example table schema (I had to
guesstimate what would work) - should this go to this list, or direct to
module author?


Cheers,

Chisel
-- 
Chisel Wright
e: chisel at herlpacker.co.uk
w: http://www.herlpacker.co.uk/

No virus was found in this outgoing message as I didn't bother looking.



More information about the Catalyst mailing list