
lannings at gmail
Apr 7, 2010, 11:46 PM
Post #4 of 9
(1204 views)
Permalink
|
On Thu, Apr 8, 2010 at 8:40 AM, Zdravko Balorda <zdravko.balorda [at] siix> wrote: > lannings [at] gmail wrote: >> Please help us help you by posting your code. >> Otherwise, we have to guess that you're not doing something like >> >> BBAB::Story->list({category_id => ANY(@ids)}) >> > Fortunately, not. > % my $cat= $story->get_primary_category; > % my @subcat = ($cat->get_children(), $cat->get_id() ); > % my $ids = join(",", map ($_->get_id, $cat->get_children()) ); > % my @listcat = Bric::Biz::Asset::Business::Story->list({ > % 'category_id'=> ANY ($ids), > % 'story.category'=> $story->get_id > % }); > > Is this right? No, you're passing a string to ANY. Instead, pass a list, like my @category_ids = map { $_->get_id } $cat->get_children(); my @listcat = Bric::Biz::Asset::Business::Story->list({ category_id => ANY(@category_ids), .... });
|