Login | Register For Free | Help
Search for: (Advanced)

Mailing List Archive: Catalyst: Users

Strange RenderView error

 

 

Catalyst users RSS feed   Index | Next | Previous | View Threaded


ivan.wills at gmail

May 21, 2009, 12:19 AM

Post #1 of 6 (616 views)
Permalink
Strange RenderView error

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.wills[at]gmail.com
/
/ _ _
/ \ / | | | |
/ \/ \_| | |


bobtfish at bobtfish

May 23, 2009, 8:10 AM

Post #2 of 6 (536 views)
Permalink
Re: Strange RenderView error [In reply to]

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[at]lists.scsys.co.uk
Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/catalyst[at]lists.scsys.co.uk/
Dev site: http://dev.catalyst.perl.org/


ivan.wills at gmail

May 23, 2009, 8:19 PM

Post #3 of 6 (526 views)
Permalink
Re: Strange RenderView error [In reply to]

2009/5/24 Tomas Doran <bobtfish[at]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[at]lists.scsys.co.uk
> Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
> Searchable archive:
> http://www.mail-archive.com/catalyst[at]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.wills[at]gmail.com
/
/ _ _
/ \ / | | | |
/ \/ \_| | |


bobtfish at bobtfish

May 24, 2009, 6:25 AM

Post #4 of 6 (531 views)
Permalink
Re: Strange RenderView error [In reply to]

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[at]lists.scsys.co.uk
Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/catalyst[at]lists.scsys.co.uk/
Dev site: http://dev.catalyst.perl.org/


ivan.wills at gmail

May 24, 2009, 1:51 PM

Post #5 of 6 (518 views)
Permalink
Re: Strange RenderView error [In reply to]

2009/5/24 Tomas Doran <bobtfish[at]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[at]lists.scsys.co.uk
> Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
> Searchable archive:
> http://www.mail-archive.com/catalyst[at]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.wills[at]gmail.com
/
/ _ _
/ \ / | | | |
/ \/ \_| | |


arodland at comcast

May 24, 2009, 2:04 PM

Post #6 of 6 (512 views)
Permalink
Re: Strange RenderView error [In reply to]

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[at]lists.scsys.co.uk
Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/catalyst[at]lists.scsys.co.uk/
Dev site: http://dev.catalyst.perl.org/

Catalyst users RSS feed   Index | Next | Previous | View Threaded
 
 


Interested in having your list archived? Contact lists@gossamer-threads.com
 
  Web Applications & Managed Hosting Powered by Gossamer Threads Inc.