[Catalyst] Adding DBIC schema causes TT error
Matt S Trout
dbix-class at trout.me.uk
Thu Jun 21 18:27:42 GMT 2007
On Thu, Jun 21, 2007 at 09:01:03AM +1000, Charlie Garrison wrote:
> Good morning,
>
> On 20/6/07 at 7:49 AM +0100, Matt S Trout
> <dbix-class at trout.me.uk> wrote:
>
> >Most probable cause:
> >
> >You've got a mistyped $c->model(...) or c.model(...) declaration somewhere
> >which is falling through to Catalyst's regex search, and -was- originally
> >finding the right class because of that but the addition of the extra class
> >has caused the hash order for the search to change and now you aren't.
> >
> >Likely candidates are either a typo or missing DB:: off a DB::Foo-style
> >DBIC::Schema model reference.
>
> In an effort to eliminate possible spelling errors as the cause,
> I removed all controllers except Root and changed Root.pm to
> only have one action (index) which simply sets
> $c->response->body. In that configuration the problem goes away.
>
> I slowly added controllers back and the problem didn't recur
> until I added the last controller back. To determine if problem
> was with that specific controller, I removed a different
> controller and the errors goes away.
>
> So, I'm not having the same problem with controllers as with
> models. There seems to be a limit on the number of controllers
> or models. I add one more and I get the 'file not found' error,
> it doesn't seem to matter which controller or model I add, only
> the number of them.
There is no such limit.
We've seen this before and it's -always- turned out to be hash-order
related in terms of the fall-through component search, a certain number
of entries causes the keys to be searched in a different order.
> At this point rather than asking for specific solutions, does
> anyone have suggestions on how to debug this problem? Bill
> suggested enabling debugging in Template::Provider (see other
> message in this thread) but I'm not having any luck with that.
Try, in your MyApp.pm, adding
sub _comp_search {
my $c = shift;
warn "Fallthrough regex search called for @_";
$c->NEXT::_comp_search(@_);
}
and looking for that warning being activated.
--
Matt S Trout Need help with your Catalyst or DBIx::Class project?
Technical Director Want a managed development or deployment platform?
Shadowcat Systems Ltd. Contact mst (at) shadowcatsystems.co.uk for a quote
http://chainsawblues.vox.com/ http://www.shadowcatsystems.co.uk/
More information about the Catalyst
mailing list