FAQ
I just upgraded to 5.66, and restarted working on my site conversion to
Catalyst.

I did the usual catalyst.pl HandelSite; *create.pl view TT TT, setup
some pages, turned on the Root::end and everything was just dandy. A
generic TT page was being served.

Then I added an SVN model:

*create.pl model SVN SVN http://path/to/repo/

I run *server.pl, and the site starts up just fine. However, after
adding the model, every page request fails with:
Caught exception in HandelSite::Model::SVN->process "HandelSite::Model::SVN did not override Catalyst::Component::process at /usr/local/share/perl/5.8.7/Catalyst/Action.pm line 46"
That's damn odd. What the heck so some generic TT pages have to do with
the model?

Here's the model:
package HandelSite::Model::SVN;
use strict;
use warnings;
use base 'Catalyst::Model::SVN';

__PACKAGE__->config(
repository => 'http://handelframework.com/svn/CPAN/Handel/',
revision => 'HEAD'
);

1;
The version of Catalyst::Model::SVN is here:
http://search.cpan.org/src/CLACO/Catalyst-Model-SVN-0.04/lib/Catalyst/Model/SVN.pm

It was build back when 5.33 was the latest, and it subclasses
Catalyst::Base.

I thought something that simple would be backwards compatable.
Apparently not.

However, what I'm more concerned about is how an unused model (I have no
controllers code, let alone ant controller code that reverences it) can
bork view processing?

Anyone?

-=Chris
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 189 bytes
Desc: OpenPGP digital signature
Url : http://lists.rawmode.org/pipermail/catalyst/attachments/20060313/b5b8ffeb/attachment.pgp

Search Discussions

  • Christopher H. Laco at Mar 14, 2006 at 3:07 am

    Christopher H. Laco wrote:
    I just upgraded to 5.66, and restarted working on my site conversion to
    Catalyst.

    I did the usual catalyst.pl HandelSite; *create.pl view TT TT, setup
    some pages, turned on the Root::end and everything was just dandy. A
    generic TT page was being served.

    Then I added an SVN model:

    *create.pl model SVN SVN http://path/to/repo/

    I run *server.pl, and the site starts up just fine. However, after
    adding the model, every page request fails with:

    Caught exception in HandelSite::Model::SVN->process "HandelSite::Model::SVN did not override Catalyst::Component::process at /usr/local/share/perl/5.8.7/Catalyst/Action.pm line 46"

    That's damn odd. What the heck so some generic TT pages have to do with
    the model?

    Here's the model:

    package HandelSite::Model::SVN;
    use strict;
    use warnings;
    use base 'Catalyst::Model::SVN';

    __PACKAGE__->config(
    repository => 'http://handelframework.com/svn/CPAN/Handel/',
    revision => 'HEAD'
    );

    1;

    The version of Catalyst::Model::SVN is here:
    http://search.cpan.org/src/CLACO/Catalyst-Model-SVN-0.04/lib/Catalyst/Model/SVN.pm

    It was build back when 5.33 was the latest, and it subclasses
    Catalyst::Base.

    I thought something that simple would be backwards compatable.
    Apparently not.

    However, what I'm more concerned about is how an unused model (I have no
    controllers code, let alone ant controller code that reverences it) can
    bork view processing?

    Anyone?

    -=Chris
    Attack of the late night stupids...

    Funny enough, this doesn't do what I want without the "TT" in there...

    $c->forward( $c->view('') ) unless $c->response->body;

    Doh!

    -=Chris
    -------------- next part --------------
    A non-text attachment was scrubbed...
    Name: signature.asc
    Type: application/pgp-signature
    Size: 189 bytes
    Desc: OpenPGP digital signature
    Url : http://lists.rawmode.org/pipermail/catalyst/attachments/20060313/fd154a0a/attachment.pgp
  • Matt S Trout at Mar 14, 2006 at 3:24 pm

    Christopher H. Laco wrote:
    Attack of the late night stupids...

    Funny enough, this doesn't do what I want without the "TT" in there...

    $c->forward( $c->view('') ) unless $c->response->body;
    It's never been documented to do so, but it will again in the next release.

    The implementation of the model/view/controller methods changed for 5.66 to
    squash a couple bugs in the behaviour that *was* documented, and this crept in
    round the edges, sorry.

    --
    Matt S Trout Offering custom development, consultancy and support
    Technical Director contracts for Catalyst, DBIx::Class and BAST. Contact
    Shadowcat Systems Ltd. mst (at) shadowcatsystems.co.uk for more information

    + Help us build a better perl ORM: http://dbix-class.shadowcatsystems.co.uk/ +
  • Christopher H. Laco at Mar 14, 2006 at 3:28 pm

    Matt S Trout wrote:
    Christopher H. Laco wrote:
    Attack of the late night stupids...

    Funny enough, this doesn't do what I want without the "TT" in there...

    $c->forward( $c->view('') ) unless $c->response->body;
    It's never been documented to do so, but it will again in the next release.

    The implementation of the model/view/controller methods changed for 5.66
    to squash a couple bugs in the behaviour that *was* documented, and this
    crept in round the edges, sorry.
    I'd say it's only a bug because it returned a Model instead of a View.
    But all in all, if I'm too silly to actually ask for a View, I should
    get nothing...well, at least deserve to get nothing. :-)

    -------------- next part --------------
    A non-text attachment was scrubbed...
    Name: signature.asc
    Type: application/pgp-signature
    Size: 189 bytes
    Desc: OpenPGP digital signature
    Url : http://lists.rawmode.org/pipermail/catalyst/attachments/20060314/3068e0ff/attachment.pgp
  • Matt S Trout at Mar 14, 2006 at 3:36 pm

    Christopher H. Laco wrote:
    I'd say it's only a bug because it returned a Model instead of a View.
    But all in all, if I'm too silly to actually ask for a View, I should
    get nothing...well, at least deserve to get nothing. :-)
    Right. now $c->view($name) where there's no MyApp::V::$name or View::$name
    will do a regex search, so you'll get the first view that matches that prefix.

    We could I guess make it an error instead - or make $c->view return the only
    view if there's just the one and error if there's more than one. What do
    people think? (and do we want views, models and controllers as methods to get
    the list to choose from?)

    --
    Matt S Trout Offering custom development, consultancy and support
    Technical Director contracts for Catalyst, DBIx::Class and BAST. Contact
    Shadowcat Systems Ltd. mst (at) shadowcatsystems.co.uk for more information

    + Help us build a better perl ORM: http://dbix-class.shadowcatsystems.co.uk/ +
  • Christopher H. Laco at Mar 14, 2006 at 4:15 pm

    Matt S Trout wrote:
    Christopher H. Laco wrote:
    I'd say it's only a bug because it returned a Model instead of a View.
    But all in all, if I'm too silly to actually ask for a View, I should
    get nothing...well, at least deserve to get nothing. :-)
    Right. now $c->view($name) where there's no MyApp::V::$name or
    View::$name will do a regex search, so you'll get the first view that
    matches that prefix.

    We could I guess make it an error instead - or make $c->view return the
    only view if there's just the one and error if there's more than one.
    What do people think? (and do we want views, models and controllers as
    methods to get the list to choose from?)
    I'm torn between JMIW (Just Make It Work), and the silly user slap
    intrinsic (Exception! You forgot to ask for anything you silly sod!).
    View is the odd sub out compared to model/controller...


    For the JMIW camp:

    $c->view('') / $c->view(undef)

    return the first view if there is only 1 view
    return the TT view if there are 2+ views, and one is TT



    $c->model('') / $c->model(undef)
    return nothing/undef/throw exception


    $c->controller('') / $c->controller(undef)
    return nothing/undef/throw exception

    -------------- next part --------------
    A non-text attachment was scrubbed...
    Name: signature.asc
    Type: application/pgp-signature
    Size: 189 bytes
    Desc: OpenPGP digital signature
    Url : http://lists.rawmode.org/pipermail/catalyst/attachments/20060314/57459169/attachment.pgp
  • Brandon Black at Mar 14, 2006 at 4:36 pm

    On 3/14/06, Christopher H. Laco wrote:
    For the JMIW camp:

    $c->view('') / $c->view(undef)

    return the first view if there is only 1 view
    return the TT view if there are 2+ views, and one is TT
    There are alternatives to TT that people might use as their "main"
    html-generating view though. Things like HTML::Template or Seamstress
    for example.

    I like the idea of returning the only view if only one is defined, and
    it probably doesn't really hurt to do it for model as well just for
    consistency's sake (the same could be said for controller as well, but
    I doubt it would ever be very useful).

    How about optional app-level config parameters "default_view", and
    "default_model". Calling ->view/model/controller with a false
    argument returns the default if that's set in config, or returns the
    only model/view if there's only one, or gives up if multiple and no
    configured default?

    -- Brandon
  • Matt S Trout at Mar 14, 2006 at 4:56 pm

    Brandon Black wrote:
    On 3/14/06, Christopher H. Laco wrote:
    For the JMIW camp:

    $c->view('') / $c->view(undef)

    return the first view if there is only 1 view
    return the TT view if there are 2+ views, and one is TT
    There are alternatives to TT that people might use as their "main"
    html-generating view though. Things like HTML::Template or Seamstress
    for example.

    I like the idea of returning the only view if only one is defined, and
    it probably doesn't really hurt to do it for model as well just for
    consistency's sake (the same could be said for controller as well, but
    I doubt it would ever be very useful).

    How about optional app-level config parameters "default_view", and
    "default_model". Calling ->view/model/controller with a false
    argument returns the default if that's set in config, or returns the
    only model/view if there's only one, or gives up if multiple and no
    configured default?
    Seconded, with the caveat that I think $c->controller() should return the
    controller that $c->action comes from.

    --
    Matt S Trout Offering custom development, consultancy and support
    Technical Director contracts for Catalyst, DBIx::Class and BAST. Contact
    Shadowcat Systems Ltd. mst (at) shadowcatsystems.co.uk for more information

    + Help us build a better perl ORM: http://dbix-class.shadowcatsystems.co.uk/ +

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
groupcatalyst @
categoriescatalyst, perl
postedMar 14, '06 at 2:53a
activeMar 14, '06 at 4:56p
posts8
users3
websitecatalystframework.org
irc#catalyst

People

Translate

site design / logo © 2022 Grokbase