[Catalyst] Adding DBIC schema causes TT error

Matt S Trout dbix-class at trout.me.uk
Thu Jun 21 18:31:54 GMT 2007


On Thu, Jun 21, 2007 at 10:30:17AM +1000, Charlie Garrison wrote:
> Good morning,
> 
> On 20/6/07 at 4:32 PM +1000, Charlie Garrison 
> <garrison at zeta.org.au> wrote:
> 
> >I've run into a problem that I can't make any progress with; 
> >hoping someone might be able offer suggestions.
> >
> >Development was moving along nicely and then I suddenly got the following 
> >error in a response:
> >
> >Couldn't render template "file error - welcome.tt2: not found"
> 
> I broke out the debugger and I think I found the cause of the 
> problem (at least *a* cause if not *the* cause). I have a custom 
> view that I use for creating email messages. That view is 
> getting found instead of the default View::TT.
> 
> That also explains why the TT:P debug output was not being 
> printed; the TT view was not being used.
> 
> So, what are my best options for fixing this? (I'd also like to 
> learn more and understand why adding another controller or 
> module causes a different view to be used.)
> 
> I'm guessing the best solution is to specify which view 
> RenderView should be using. I have done that by adding 
> "default_view => 'TT'" to MyApp->config.
> 
> __PACKAGE__->config(
>     name => 'MyApp',
>     default_view => 'TT',
>     ....
> );
> 
> I also tested by setting current_view in the end/RenderView action.
> 
> $c->stash->{current_view} = 'TT';
> 
> Is one of those a 'preferred' method for setting the default view?

Well, one is global and one is per-request.

So both are preferred for their specific purpose :)
 
> Is the problem I encountered symptomatic of a bug within 
> Catalyst that needs to be fixed? As a 'quick' solution can I 
> suggest the Catalyst debug output show which view is being used. 
> Knowing that a different view was being used would have saved me 
> many hours on this.

I think we'll probably make the fallthrough regex either warn or (if nobody's
actually relying on it, which I -hope- they aren't) simply not exist in 5.80.

I've never seen it mentioned in over a year except as a causer of bugs, so
I think it may be time to screw backcompat on that particular misfeature and
do something more sensible.

-- 
      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