Re: ax2: base-class in XSP documents fails
On Tue, Jun 17, 2008 at 4:39 PM, Matt Sergeant wrote: Fixed in SVN (I think). I still get an error when I use My::BaseClass::SubClass as a base-class, which inherits the handler method from My::BaseClass. Which makes sense: in _load_module() only My::BaseClass::SubClass is added to %INC; hence My::BaseClass::SubClass-can('handler') returns false. Indeed, if I visit another page, that uses My::BaseClass as its base-class, then it is added to %INC and any the error won't appear on subsequent visits to the original page. Until, of course, the AxKit-server is started again. I easily fixed this by adding the line require My::BaseClass; to My::BaseClass::SubClass, but I thought I'd share this anyway to save others from half an hour of digging through Perl code. :-) Martijn. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: ax2: base-class in XSP documents fails
On Wed, 25 Jun 2008, Martijn wrote: On Tue, Jun 17, 2008 at 4:39 PM, Matt Sergeant wrote: Fixed in SVN (I think). I still get an error when I use My::BaseClass::SubClass as a base-class, which inherits the handler method from My::BaseClass. Which makes sense: in _load_module() only My::BaseClass::SubClass is added to %INC; hence My::BaseClass::SubClass-can('handler') returns false. Indeed, if I visit another page, that uses My::BaseClass as its base-class, then it is added to %INC and any the error won't appear on subsequent visits to the original page. Until, of course, the AxKit-server is started again. How do you mean inherits from? If you're just doing @ISA = qw(My::BaseClass); that's not enough - try use base qw(My::BaseClass); instead. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: ax2: base-class in XSP documents fails
On Wed, Jun 25, 2008 at 1:50 PM, wrote: How do you mean inherits from? If you're just doing @ISA = qw(My::BaseClass); that's not enough - try use base qw(My::BaseClass); instead. That's exactly what I did. Thanks. Martijn. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: ax2: base-class in XSP documents fails
On Wed, Jun 25, 2008 at 2:18 PM, Martijn wrote: That's exactly what I did. Thanks. That's exactly what I did *wrong* I meant to say. :-) Speaking of XSP, would it be worth adding a line no warnings 'redefine'; to the XSP-blurb that is being evaluated? Otherwise, I get tons of 'subroutine ... redefined' warnings when an XSP page is loaded again. Martijn. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: ax2: base-class in XSP documents fails
On Wed, 25 Jun 2008, Martijn wrote: On Wed, Jun 25, 2008 at 2:18 PM, Martijn wrote: That's exactly what I did. Thanks. That's exactly what I did *wrong* I meant to say. :-) Speaking of XSP, would it be worth adding a line no warnings 'redefine'; to the XSP-blurb that is being evaluated? Otherwise, I get tons of 'subroutine ... redefined' warnings when an XSP page is loaded again. Yes, probably a good plan. Though presumably you mean after it has changed? It should only recompile it if it has changed since the first loading... - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: ax2: base-class in XSP documents fails
On Fri, 6 Jun 2008 15:48:59 +0100, Martijn wrote: Hello again. Not sure if this is a bug, but I can't get AxKit2 to use base classes in XSP documents, via the base-class attribute of the xsp:page root element. Whenever I try to add a perl module that contains only an empty handler subroutine, I get the following error: The following error occurred: base-class used but cannot find a handler() method in the My::Page class. Did you remember to add PerlModule My::Page to httpd.conf? at lib/AxKit2/Transformer/XSP.pm line 553. Looking into XSP.pm, the error is caused by $attribs{'base-class'}-can(handler) returning false, even though a handler() method exist (a call to My::Page-can('handler') returns true inside the XSP document) and even though $attribs{'base-class'} has the correct value. Is there perhaps an AxKit2 equivalent of PerlModule I have missed? Fixed in SVN (I think). - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]