[jifty-devel] Using Scalar::Defer in J::A::CreateXXX causes an error

Jesse Vincent jesse at bestpractical.com
Wed Apr 25 18:01:17 EDT 2007


I'm not quite understanding. Can you throw together a demo app?

------- Original message -------
From: IN SUK JOUNG <i.joung at gmail.com>
Sent: 4/21,  23:12

> I have a problem in writing a 'param' in J::A::CreateXXX.
> 
> The action param below works in normal actions(MyWeblog::Action::XXXX) but causes an error in MyWeblog::Action::CreateXXX.
> Error in C:\Perl\site\lib\Scalar\Defer.pm line 41
> Undefined subroutine &main:: called at C:/Perl/site/lib/Scalar/Defer.pm line 41.
> 
>     param mother =>
>         render as 'select',
>         label is 'Mother Group',
>         valid_values are defer {
>             my $collection = MyWeblog::Model::GroupCollection->new;
>             $collection->unlimit;
>             my @results = { display => 'Top Group', value => 0 };
>             while ( my $record = $collection->next ) {
>                 push @results, {
>                     display => $record->group_id,
>                     value   => $record->id,
>                 };
>             }
>             return \@results;
>         };
> 
> How do I override params like this in  MyWeblog::Action::CreateXXX?
> --
> Best,
> In-Suk Joung 


More information about the jifty-devel mailing list