Re: [Catalyst] I18N with variables

2010-08-09 Thread Tomas Doran


On 7 Aug 2010, at 01:03, Ton Voon wrote:


 I can write a Cat advent calendar entry for this if interested.


YES!

We were happy to take submissions for this years advent as of Jan 1st,  
so please do so! ;)


(Any time before mid december)

Cheers
t0m


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


Re: [Catalyst] DBIC custom SQL hack stopped working after upgrading Catalyst

2010-08-09 Thread Tobias Kremer
Hey t0m,

 Couldn't load class (MyApp) because:
 DBIx::Class::Row::throw_exception(): Can't locate object method
 register_source via package MyApp::Schema at
 xxx/MyApp/Schema/User.pm line 357 (see line below).
 Can you load Devel::SimpleTrace and get a full stack trace of the failure?

Sure, see below.

Is it possible that this has got something to do with me explicitly
use'ing some Schema classes in controllers because they have some
constants defined that I need to access? For instance,
Controller::Club, line 7 says: use MyApp::Schema::Club which provides
something like MyApp::Schema::Club::MAX_NO_OF_FOO that is used within
the controller.

Thanks for your help!
--Tobias


Couldn't load class (MyApp) because:
DBIx::Class::Row::throw_exception(): Can't locate object method
register_source via package MyApp::Schema
at eval(/home/dev/MyApp/script/../lib/MyApp/Schema/User.pm:357)
at 
eval(/home/dev/MyApp/dbic_cat_upgrade/lib/perl5/Class/C3/Componentised.pm:128)
at 
Class::C3::Componentised::ensure_class_loaded(/home/dev/MyApp/dbic_cat_upgrade/lib/perl5/Class/C3/Componentised.pm:128)
at 
DBIx::Class::Relationship::BelongsTo::belongs_to(/home/dev/MyApp/dbic_cat_upgrade/lib/perl5/DBIx/Class/Relationship/BelongsTo.pm:28)
at eval(/home/dev/MyApp/script/../lib/MyApp/Schema/Club.pm:144)
at 
MyApp::Controller::Club::BEGIN(/home/dev/MyApp/script/../lib/MyApp/Controller/Club.pm:7)
at eval(/home/dev/MyApp/script/../lib/MyApp/Schema/User.pm)
at eval(/home/dev/MyApp/script/../lib/MyApp/Schema/User.pm)
at 
eval(/home/dev/MyApp/dbic_cat_upgrade/lib/perl5/Catalyst/Utils.pm:281)
at 
Catalyst::Utils::ensure_class_loaded(/home/dev/MyApp/dbic_cat_upgrade/lib/perl5/Catalyst/Utils.pm:281)
at 
Catalyst::setup_components(/home/dev/MyApp/dbic_cat_upgrade/lib/perl5/Catalyst.pm:2423)
at 
Catalyst::setup(/home/dev/MyApp/dbic_cat_upgrade/lib/perl5/Catalyst.pm:1157)
at eval(/home/dev/MyApp/script/../lib/MyApp.pm:68)
at 
Class::MOP::__ANON__(/home/dev/MyApp/dbic_cat_upgrade/lib/perl5/x86_64-linux-gnu-thread-multi/Class/MOP.pm:114)
at eval(/home/dev/MyApp/dbic_cat_upgrade/lib/perl5/Try/Tiny.pm:71)
at 
Try::Tiny::try(/home/dev/MyApp/dbic_cat_upgrade/lib/perl5/Try/Tiny.pm:67)
at 
Class::MOP::load_first_existing_class(/home/dev/MyApp/dbic_cat_upgrade/lib/perl5/x86_64-linux-gnu-thread-multi/Class/MOP.pm:125)
at 
Class::MOP::load_class(/home/dev/MyApp/dbic_cat_upgrade/lib/perl5/x86_64-linux-gnu-thread-multi/Class/MOP.pm:137)
at 
Catalyst::ScriptRole::_run_application(/home/dev/MyApp/dbic_cat_upgrade/lib/perl5/Catalyst/ScriptRole.pm:61)
at 
Catalyst::Script::Server::__ANON__(/home/dev/MyApp/dbic_cat_upgrade/lib/perl5/Catalyst/Script/Server.pm:144)
at 
Catalyst::Restarter::Forking::_fork_and_start(/usr/local/share/perl/5.10.0/Catalyst/Restarter/Forking.pm:20)
at 
Catalyst::Restarter::run_and_watch(/usr/local/share/perl/5.10.0/Catalyst/Restarter.pm:89)
at 
Catalyst::Script::Server::run(/home/dev/MyApp/dbic_cat_upgrade/lib/perl5/Catalyst/Script/Server.pm:178)
at 
Class::MOP::Method::Wrapped::__ANON__(/home/dev/MyApp/dbic_cat_upgrade/lib/perl5/x86_64-linux-gnu-thread-multi/Class/MOP/Method/Wrapped.pm:48)
at 
Catalyst::Script::Server::run(/home/dev/MyApp/dbic_cat_upgrade/lib/perl5/x86_64-linux-gnu-thread-multi/Class/MOP/Method/Wrapped.pm:89)
at 
Catalyst::ScriptRunner::run(/home/dev/MyApp/dbic_cat_upgrade/lib/perl5/Catalyst/ScriptRunner.pm:20)
at main::(script/MyApp_server.pl:8)
Compilation failed in require at
/home/dev/MyApp/dbic_cat_upgrade/lib/perl5/Class/C3/Componentised.pm
line 128.
Compilation failed in require at
/home/dev/MyApp/script/../lib/MyApp/Controller/Club.pm line 7.
BEGIN failed--compilation aborted at
/home/dev/MyApp/script/../lib/MyApp/Controller/Club.pm line 7.
Compilation failed in require at
/home/dev/MyApp/dbic_cat_upgrade/lib/perl5/Catalyst/Utils.pm line 281.
Compilation failed in require at
/home/dev/MyApp/dbic_cat_upgrade/lib/perl5/x86_64-linux-gnu-thread-multi/Class/MOP.pm
line 114.
 at 
/home/dev/MyApp/dbic_cat_upgrade/lib/perl5/x86_64-linux-gnu-thread-multi/Class/MOP.pm
line 120
Class::MOP::__ANON__('DBIx::Class::Row::throw_exception(): Can\'t
locate object met...') called at
/home/dev/MyApp/dbic_cat_upgrade/lib/perl5/Try/Tiny.pm line 98
Try::Tiny::try('CODE(0x244b918)', 'Try::Tiny::Catch=REF(0x25809a0)')
called at 
/home/dev/MyApp/dbic_cat_upgrade/lib/perl5/x86_64-linux-gnu-thread-multi/Class/MOP.pm
line 125
Class::MOP::load_first_existing_class('MyApp') called at
/home/dev/MyApp/dbic_cat_upgrade/lib/perl5/x86_64-linux-gnu-thread-multi/Class/MOP.pm
line 137
Class::MOP::load_class('MyApp') called at
/home/dev/MyApp/dbic_cat_upgrade/lib/perl5/Catalyst/ScriptRole.pm line
61

Catalyst::ScriptRole::_run_application('Catalyst::Script::Server=HASH(0x1275f00)')
called at 

Re: [Catalyst] DBIC custom SQL hack stopped working after upgrading Catalyst

2010-08-09 Thread Tobias Kremer
On Mon, Aug 9, 2010 at 12:24 PM, Tobias Kremer tobias.kre...@gmail.com wrote:
 Couldn't load class (MyApp) because:
 DBIx::Class::Row::throw_exception(): Can't locate object method
 register_source via package MyApp::Schema at
 xxx/MyApp/Schema/User.pm line 357 (see line below).
 Can you load Devel::SimpleTrace and get a full stack trace of the failure?
 Is it possible that this has got something to do with me explicitly
 use'ing some Schema classes in controllers because they have some
 constants defined that I need to access?

My suspicion was right: After removing all use MyApp::Schema::*
occurrences from our controllers the app started. Nevertheless, I'm
not sure if this is expected behaviour.

I skimmed through the mailing list archive and found a thread about
how best to arrange constants and the recommendation was to create a
separate MyApp::Constants class. But to me it sounds more rational to
store, say different role IDs as constants in the corresponding
MyApp::Schema::Role model class...

Any thoughts?

--Tobias

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