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

Mailing List Archive: Catalyst: Users

Strange warning...

 

 

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


rippls at woodlandschools

Nov 20, 2009, 9:50 AM

Post #1 of 7 (1229 views)
Permalink
Strange warning...

Hi,

Catalyst version 5.80011

This line...

$c->response->redirect($c->uri_for($c->controller('WsdSis::Controller::Section')->action_for('list')));

is giving me this warning...

[warn] Used regexp fallback for
$c->controller('WsdSis::Controller::Section'), which found
'WsdSis::Controller::Sections'. Relying on regexp fallback behavior for
component resolution is unreliable and unsafe. You probably meant
$c->controller('WsdSis::Controller::Sections') instead of
$c->controller({'WsdSis::Controller::Section'}), but if you really
wanted to search, pass in a regexp as the argument like so:
$c->controller(qr/WsdSis::Controller::Section/)
at /srv/WsdSis/script/../lib/WsdSis/Controller/Login.pm line 50

But I haven't got $c->controller({'WsdSis::Controller::Section'}) in my
code?

What am I missing?

Thanks,
Steve


--
Steve Rippl
Technology Director
Woodland Public Schools
360 225 9451 x326


jshirley at gmail

Nov 20, 2009, 10:16 AM

Post #2 of 7 (1164 views)
Permalink
Re: Strange warning... [In reply to]

On Fri, Nov 20, 2009 at 9:50 AM, Rippl, Steve <rippls [at] woodlandschools>wrote:

> Hi,
>
> Catalyst version 5.80011
>
> This line...
>
>
> $c->response->redirect($c->uri_for($c->controller('WsdSis::Controller::Section')->action_for('list')));
>
> is giving me this warning...
>
> [warn] Used regexp fallback for
> $c->controller('WsdSis::Controller::Section'), which found
> 'WsdSis::Controller::Sections'. Relying on regexp fallback behavior for
> component resolution is unreliable and unsafe. You probably meant
> $c->controller('WsdSis::Controller::Sections') instead of
> $c->controller({'WsdSis::Controller::Section'}), but if you really
> wanted to search, pass in a regexp as the argument like so:
> $c->controller(qr/WsdSis::Controller::Section/)
> at /srv/WsdSis/script/../lib/WsdSis/Controller/Login.pm line 50
>
> But I haven't got $c->controller({'WsdSis::Controller::Section'}) in my
> code?
>
> What am I missing?
>
>
> You said this line:
$c->response->redirect($c->uri_for($c->controller('WsdSis::Controller::Section')->action_for('list')));


Notice Section is not Sections?

That's what you are missing :)

-J


alan.humphrey at comcast

Nov 20, 2009, 10:19 AM

Post #3 of 7 (1167 views)
Permalink
RE: Strange warning... [In reply to]

I had this problem the other day and it was hell to figure out because I
couldn't see the error in front of my face.



Your line:



$c->response->redirect($c->uri_for($c->controller('WsdSis::Controller::Secti
on')->action_for('list')));



Is missing an 's' after "Section".





- Alan



From: Rippl, Steve [mailto:rippls [at] woodlandschools]
Sent: Friday, November 20, 2009 9:50 AM
To: catalyst [at] lists
Subject: [Catalyst] Strange warning...



Hi,

Catalyst version 5.80011

This line...

$c->response->redirect($c->uri_for($c->controller('WsdSis::Controller::Secti
on')->action_for('list')));

is giving me this warning...

[warn] Used regexp fallback for
$c->controller('WsdSis::Controller::Section'), which found
'WsdSis::Controller::Sections'. Relying on regexp fallback behavior for
component resolution is unreliable and unsafe. You probably meant
$c->controller('WsdSis::Controller::Sections') instead of
$c->controller({'WsdSis::Controller::Section'}), but if you really
wanted to search, pass in a regexp as the argument like so:
$c->controller(qr/WsdSis::Controller::Section/)
at /srv/WsdSis/script/../lib/WsdSis/Controller/Login.pm line 50

But I haven't got $c->controller({'WsdSis::Controller::Section'}) in my
code?

What am I missing?

Thanks,
Steve


--
Steve Rippl
Technology Director
Woodland Public Schools
360 225 9451 x326


bobtfish at bobtfish

Nov 20, 2009, 10:19 AM

Post #4 of 7 (1153 views)
Permalink
Re: Strange warning... [In reply to]

Rippl, Steve wrote:
> Hi,
>
> Catalyst version 5.80011
>
> This line...
>
> $c->response->redirect($c->uri_for($c->controller('WsdSis::Controller::Section')->action_for('list')));
>
> is giving me this warning...
>
> [warn] Used regexp fallback for
> $c->controller('WsdSis::Controller::Section'), which found
> 'WsdSis::Controller::Sections'. Relying on regexp fallback behavior for
> component resolution is unreliable and unsafe. You probably meant
> $c->controller('WsdSis::Controller::Sections') instead of
> $c->controller({'WsdSis::Controller::Section'}), but if you really
> wanted to search, pass in a regexp as the argument like so:
> $c->controller(qr/WsdSis::Controller::Section/)
> at /srv/WsdSis/script/../lib/WsdSis/Controller/Login.pm line 50
>
> But I haven't got $c->controller({'WsdSis::Controller::Section'}) in my
> code?
>
> What am I missing?

You're either passing in the full class name (i.e.
WsdSis::Controller::Section is wrong, you want to just pass Section), or
you've got a singular vs plural issue?

Can you show us the code around line 50 which is fingered by the warning
message?

I note that message isn't too helpful, and has been improved in the next
release of Catalyst..

Cheers
t0m

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


rippls at woodlandschools

Nov 20, 2009, 10:40 AM

Post #5 of 7 (1163 views)
Permalink
Re: Strange warning... [In reply to]

On Fri, 2009-11-20 at 18:19 +0000, Tomas Doran wrote:
>
> You're either passing in the full class name (i.e.
> WsdSis::Controller::Section is wrong, you want to just pass Section), or
> you've got a singular vs plural issue?
>
> Can you show us the code around line 50 which is fingered by the warning
> message?
>
> I note that message isn't too helpful, and has been improved in the next
> release of Catalyst..
>
> Cheers
> t0m


Well I definitely missed the s on Sections (doh!), but when I put that
in I got

[warn] Used regexp fallback for
$c->controller('WsdSis::Controller::Sections'), which found
'WsdSis::Controller::Sections'. Relying on regexp fallback behavior for
component resolution is unreliable and unsafe. You probably meant
$c->controller('WsdSis::Controller::Sections') instead of
$c->controller({'WsdSis::Controller::Sections'}), but if you really
wanted to search, pass in a regexp as the argument like so:
$c->controller(qr/WsdSis::Controller::Sections/)
at /srv/WsdSis/script/../lib/WsdSis/Controller/Login.pm line 50

When I change line 50 to

$c->response->redirect($c->uri_for($c->controller('Sections')->action_for('list')));

it stops warning me. Not sure where I got the idea to put
WsdSis::Controller::Sections (with the plural would help), so it's wrong
to pass in a full class name?


Thanks to all that responded so quickly!

Steve


--
Steve Rippl
Technology Director
Woodland Public Schools
360 225 9451 x326

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


bobtfish at bobtfish

Nov 20, 2009, 2:38 PM

Post #6 of 7 (1146 views)
Permalink
Re: Strange warning... [In reply to]

On 20 Nov 2009, at 18:40, Steve Rippl wrote:
>
> it stops warning me. Not sure where I got the idea to put
> WsdSis::Controller::Sections (with the plural would help), so it's
> wrong
> to pass in a full class name?

Yes.

> On Fri, 2009-11-20 at 18:19 +0000, Tomas Doran wrote:
>>
>> I note that message isn't too helpful, and has been improved in the
>> next
>> release of Catalyst..


In fact, it's the fact the error message doesn't tell you what you
_should_ put (i.e. doesn't chop off MyApp::Controller::) which was
fixed.

Cheers
t0m



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


pagaltzis at gmx

Nov 22, 2009, 5:12 AM

Post #7 of 7 (1108 views)
Permalink
Re: Strange warning... [In reply to]

* Rippl, Steve <rippls [at] woodlandschools> [2009-11-20 19:00]:
> Catalyst version 5.80011
>
> $c->response->redirect($c->uri_for($c->controller('WsdSis::Controller::Section')->action_for('list')));

$c->response->redirect($c->uri_for_action('/sections/list'));

Regards,
--
Aristotle Pagaltzis // <http://plasmasturm.org/>

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

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


Interested in having your list archived? Contact Gossamer Threads
 
  Web Applications & Managed Hosting Powered by Gossamer Threads Inc.