Re: [Catalyst] Strange RenderView error

2009-05-24 Thread Tomas Doran

Ivan Wills wrote:
I have finally worked out what was causing me the problem, if I take 
away the :Arg(0) from the sub definition the error goes away.


Does any one know what :Arg(0) is doing that might be causing this?


Erm, which subroutine definition?

I just generated a TestApp, and changed 'sub index : Args(0)' to 'sub 
index : Arg(0)' and it works fine.


Can you show us the code for a controller I can add to a TestApp which 
breaks it or something?


Cheers
t0m


___
List: Catalyst@lists.scsys.co.uk
Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/catalyst@lists.scsys.co.uk/
Dev site: http://dev.catalyst.perl.org/


Re: [Catalyst] Strange RenderView error

2009-05-24 Thread Ivan Wills
2009/5/24 Tomas Doran bobtf...@bobtfish.net

 Ivan Wills wrote:

 I have finally worked out what was causing me the problem, if I take away
 the :Arg(0) from the sub definition the error goes away.

 Does any one know what :Arg(0) is doing that might be causing this?


 Erm, which subroutine definition?

 I just generated a TestApp, and changed 'sub index : Args(0)' to 'sub index
 : Arg(0)' and it works fine.

 Can you show us the code for a controller I can add to a TestApp which
 breaks it or something?


 Cheers
 t0m


 ___
 List: Catalyst@lists.scsys.co.uk
 Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
 Searchable archive:
 http://www.mail-archive.com/catalyst@lists.scsys.co.uk/
 Dev site: http://dev.catalyst.perl.org/


The code was something like this

sub index :Path :Arg(0) {}
sub add :Path :Arg(0) {}

To get it working I changed this to

sub index :Path :Arg(0) {}
sub add :Path {}

If I understand it correctly the :Arg attribute takes extra path parameters
and converts them to method parameters so I can't see why the problem would
occur.

Ivan

-- 
email/jabber:  ivan.wi...@gmail.com
  /
 /   _   _
/  \  / | | | |
/\/  \_| | |
___
List: Catalyst@lists.scsys.co.uk
Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/catalyst@lists.scsys.co.uk/
Dev site: http://dev.catalyst.perl.org/


Re: [Catalyst] Strange RenderView error

2009-05-24 Thread Andrew Rodland
On Sunday 24 May 2009 03:51:47 pm Ivan Wills wrote:
 If I understand it correctly the :Arg attribute takes extra path parameters
 and converts them to method parameters so I can't see why the problem would
 occur.

1. That happens by default.
2. :Args(0) says that there are _no_ extra args on the path and the dispatcher 
shouldn't match them.
3. :Arg(0) does nothing (at least, it should do nothing) because it's not 
:Args(0).

Andrew


___
List: Catalyst@lists.scsys.co.uk
Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/catalyst@lists.scsys.co.uk/
Dev site: http://dev.catalyst.perl.org/


Re: [Catalyst] Strange RenderView error

2009-05-23 Thread Tomas Doran

Ivan Wills wrote:

|Caught exception in Diet::Controller::Root-end Can't use an undefined value as a 
HASH reference at /usr/local/share/perl/5.10.0/Catalyst/Action/RenderView.pm line 34.|

This only with one of my controllers all the others work fine, also the 
line mentioned in RenderView uses /$c-req-params-{dump_info}/ so I 
assume params is some how being undefined.


I have tried setting/not setting templates and even removing the entire 
body of the index method none of these effect the error.


Any ideas about how to fix this? I am using Catalyst 5.80004.


Hmm, I can't really tell what is going on / guess at the reason for the 
error from that.


My wild stab in the dark guess would be that you use using Moose in 
MyApp.pm, and saying __PACKAGE__-meta-make_immutable, rather than 
__PACKAGE__-meta-make_immutable(replace_constructor = 1);


If you've still got this issue, could you tear your app apart into a 
test case?


(I.e. make a new TestAppp and copy in the 'special' controller in 
question, and MyApp.pm, and Controller::Root, make t/01app.t fail and 
throw a tarball online / shove it on github)...


This is likely to reveal the issue by itself, but if it doesn't, it's a 
nice minimum set that someone else can experiment with..


Cheers
t0m

___
List: Catalyst@lists.scsys.co.uk
Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/catalyst@lists.scsys.co.uk/
Dev site: http://dev.catalyst.perl.org/


Re: [Catalyst] Strange RenderView error

2009-05-23 Thread Ivan Wills
2009/5/24 Tomas Doran bobtf...@bobtfish.net

 Ivan Wills wrote:

 |Caught exception in Diet::Controller::Root-end Can't use an undefined
 value as a HASH reference at
 /usr/local/share/perl/5.10.0/Catalyst/Action/RenderView.pm line 34.|

 This only with one of my controllers all the others work fine, also the
 line mentioned in RenderView uses /$c-req-params-{dump_info}/ so I assume
 params is some how being undefined.

 I have tried setting/not setting templates and even removing the entire
 body of the index method none of these effect the error.

 Any ideas about how to fix this? I am using Catalyst 5.80004.


 Hmm, I can't really tell what is going on / guess at the reason for the
 error from that.

 My wild stab in the dark guess would be that you use using Moose in
 MyApp.pm, and saying __PACKAGE__-meta-make_immutable, rather than
 __PACKAGE__-meta-make_immutable(replace_constructor = 1);

 If you've still got this issue, could you tear your app apart into a test
 case?

 (I.e. make a new TestAppp and copy in the 'special' controller in question,
 and MyApp.pm, and Controller::Root, make t/01app.t fail and throw a tarball
 online / shove it on github)...

 This is likely to reveal the issue by itself, but if it doesn't, it's a
 nice minimum set that someone else can experiment with..

 Cheers
 t0m

 ___
 List: Catalyst@lists.scsys.co.uk
 Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
 Searchable archive:
 http://www.mail-archive.com/catalyst@lists.scsys.co.uk/
 Dev site: http://dev.catalyst.perl.org/


I have finally worked out what was causing me the problem, if I take away
the :Arg(0) from the sub definition the error goes away.

Does any one know what :Arg(0) is doing that might be causing this?

Ivan

-- 
email/jabber:  ivan.wi...@gmail.com
  /
 /   _   _
/  \  / | | | |
/\/  \_| | |
___
List: Catalyst@lists.scsys.co.uk
Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/catalyst@lists.scsys.co.uk/
Dev site: http://dev.catalyst.perl.org/


[Catalyst] Strange RenderView error

2009-05-21 Thread Ivan Wills
Hi,

I'm getting the following error

Caught exception in Diet::Controller::Root-end Can't use an
undefined value as a HASH reference at
/usr/local/share/perl/5.10.0/Catalyst/Action/RenderView.pm line 34.

This only with one of my controllers all the others work fine, also the line
mentioned in RenderView uses *$c-req-params-{dump_info}* so I assume
params is some how being undefined.

I have tried setting/not setting templates and even removing the entire body
of the index method none of these effect the error.

Any ideas about how to fix this? I am using Catalyst 5.80004.

Thanks,
Ivan
*
*--
email/jabber:  ivan.wi...@gmail.com
  /
 /   _   _
/  \  / | | | |
/\/  \_| | |
___
List: Catalyst@lists.scsys.co.uk
Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/catalyst@lists.scsys.co.uk/
Dev site: http://dev.catalyst.perl.org/