List Info

Thread: Re: Too many Bric::Biz::Category objects found.




Re: Too many Bric::Biz::Category objects found.
user name
2007-09-17 07:39:49
On Mon, 17 Sep 2007, Matt Rolf wrote:
>   Turned out that the problem was we had an 
> identically uri'd category in another site.
>
> The template line that caused the problem is the
following:
>
> 	my $cat2 = Bric::Biz::Category->lookup({ uri =>

> '/'.$categories[1].'/'.$secondaryCat });
>
> Which leads to this error:
>
> Too many Bric::Biz::Category objects found.
[...]
> Looks like we can fix it by using this?
>
> list Bric::Biz::Category($crit);

Where presumably $crit contains site => 'some site' .

> Would it be useful to have the first call by default
look in the site
> the template's being run in?

I think so. The current behavior is to fail
if more than one cat is returned by `lookup'
(or any `lookup' for that matter);
also, before there were such things as "sites"
(a few years ago), the "current site" was
implicit;
so in terms of backwards compatibility,
I think we can say that limiting it to the current category
wouldn't break anything.

Re: Too many Bric::Biz::Category objects found.
user name
2007-09-17 07:53:03
On Mon, 17 Sep 2007, Scott Lanning wrote:
> On Mon, 17 Sep 2007, Matt Rolf wrote:
>> Would it be useful to have the first call by
default look in the site
>> the template's being run in?
>
> I think so. The current behavior is to fail
> if more than one cat is returned by `lookup'
> (or any `lookup' for that matter);
> also, before there were such things as
"sites"
> (a few years ago), the "current site" was
implicit;
> so in terms of backwards compatibility,
> I think we can say that limiting it to the current
category
> wouldn't break anything.

On second thought.... I think the Category class
doesn't have any concept of templates/burner,
so I'm not sure "the current site" makes sense...
  I think it might be necessary after all
to pass the site argument to `list'
(sorry I said `lookup' previously).

[1-2]

about | contact  Other archives ( Real Estate discussion Medical topics )