List Info

Thread: Story->List() Limit Over 300 Errors




Story->List() Limit Over 300 Errors
user name
2007-02-27 15:51:43
I am working on an XML feed (from the Bricolage.cc Site
Templates) that 
I have modified to include some other data. My goal is to be
able to 
generate XML feeds for certain categories, and even the
entire site.

I have got it working with limits <= 300. When I set the
limit in the 
xml_feed.mc template greater than 300 I get the following
error:

An error occurred while processing your request:
Can't call method "get_elements" on an undefined
value at 
/usr/local/bricolage/data/burn/comp/oc_1030/output_rss_feed.
mc line 49.
Please report this error to your administrator.

I think the upper limit for my number of stories is near the
5000 mark.

Can anyone shed some light on this?

Regards,

Wayne
Re: Story->List() Limit Over 300 Errors
user name
2007-02-27 16:03:29
On Tue, 27 Feb 2007, Wayne Slavin wrote:
> I am working on an XML feed (from the Bricolage.cc Site
Templates) that I 
> have modified to include some other data. My goal is to
be able to generate 
> XML feeds for certain categories, and even the entire
site.
>
> I have got it working with limits <= 300. When I set
the limit in the 
> xml_feed.mc template greater than 300 I get the
following error:
>
> An error occurred while processing your request:
> Can't call method "get_elements" on an
undefined value at 
>
/usr/local/bricolage/data/burn/comp/oc_1030/output_rss_feed.
mc line 49.
> Please report this error to your administrator.
>
> I think the upper limit for my number of stories is
near the 5000 mark.
>
> Can anyone shed some light on this?

I doubt it's related to the limit, but rather that a
particular
story after the 300th one is triggering this error in your
template.
What's at
/usr/local/bricolage/data/burn/comp/oc_1030/output_rss_feed.
mc
line 49 ?

Re: Story->List() Limit Over 300 Errors
user name
2007-03-06 02:35:29
Scott,

Line 49 begins with foreach:

  <item>
    <title><![CDATA[<% $title
%>]]></title>
    <link><% $url %></link>
    <description><% $elem->get_data('deck')
%><!--more-->
    <%perl>
    foreach my $e ($page->get_elements) {
        if ($e->has_name('paragraph')) {
    if ($count <= 85){
           
$m->out('</p><i>'.$e->get_data.'</i>
<p>');
    }
    $count += {[split /s+/, $e->get_data]};
    }}
    </%perl>
<br/><br/><a href="<%
$elem->get_data('original_url') 
%>">Via</a></description>
    <pubDate><% $doc->get_cover_date('%a, %e %b
%Y %H:%M:%S -0800') 
%></pubDate>
    <category><% join('
</category><category> ', map { $_->get_name }

$doc->get_keywords()) %></category>
   <% $contributors %>
  </item>

Thanks,

Wayne

Wayne Slavin wrote:
> I am working on an XML feed (from the Bricolage.cc Site
Templates) 
> that I have modified to include some other data. My
goal is to be able 
> to generate XML feeds for certain categories, and even
the entire site.
>
> I have got it working with limits <= 300. When I set
the limit in the 
> xml_feed.mc template greater than 300 I get the
following error:
>
> An error occurred while processing your request:
> Can't call method "get_elements" on an
undefined value at 
>
/usr/local/bricolage/data/burn/comp/oc_1030/output_rss_feed.
mc line 49.
> Please report this error to your administrator.
>
> I think the upper limit for my number of stories is
near the 5000 mark.
>
> Can anyone shed some light on this?
>
> Regards,
>
> Wayne
>

Re: Story->List() Limit Over 300 Errors
user name
2007-03-06 05:30:07
It means that $page is undef. What is $page?
I'd guess you have an off-by-one error or something.

On Tue, 6 Mar 2007, Wayne Slavin wrote:
> Scott,
>
> Line 49 begins with foreach:
>
> <item>
>   <title><![CDATA[<% $title
%>]]></title>
>   <link><% $url %></link>
>   <description><% $elem->get_data('deck')
%><!--more-->
>   <%perl>
>   foreach my $e ($page->get_elements) {
>       if ($e->has_name('paragraph')) {
>   if ($count <= 85){
>          
$m->out('</p><i>'.$e->get_data.'</i>
<p>');
>   }
>   $count += {[split /s+/, $e->get_data]};
>   }}
>   </%perl>
> <br/><br/><a href="<%
$elem->get_data('original_url') 
> %>">Via</a></description>
>   <pubDate><% $doc->get_cover_date('%a, %e
%b %Y %H:%M:%S -0800') 
> %></pubDate>
>   <category><% join('
</category><category> ', map { $_->get_name }

> $doc->get_keywords()) %></category>
>  <% $contributors %>
> </item>
>
> Thanks,
>
> Wayne
>
> Wayne Slavin wrote:
>> I am working on an XML feed (from the Bricolage.cc
Site Templates) that I 
>> have modified to include some other data. My goal
is to be able to generate 
>> XML feeds for certain categories, and even the
entire site.
>> 
>> I have got it working with limits <= 300. When I
set the limit in the 
>> xml_feed.mc template greater than 300 I get the
following error:
>> 
>> An error occurred while processing your request:
>> Can't call method "get_elements" on an
undefined value at 
>>
/usr/local/bricolage/data/burn/comp/oc_1030/output_rss_feed.
mc line 49.
>> Please report this error to your administrator.
>> 
>> I think the upper limit for my number of stories is
near the 5000 mark.
>> 
>> Can anyone shed some light on this?
>> 
>> Regards,
>> 
>> Wayne
>> 
>

Re: Story->List() Limit Over 300 Errors
user name
2007-03-06 10:30:27
%      my $page = $elem->get_container('page');
%      my $count = 0;

For each story I get the deck and then I have a page with
paragraphs, 
however using $elem->get_data('page') does not work.

It could be possible, though I don't know for sure that a
page could 
have only a deck and no page... is this where my problem
might be coming 
from? How do I deal?

Thanks for your help.

Wayne

Wayne Slavin wrote:
> Scott,
>
> Line 49 begins with foreach:
>
>  <item>
>    <title><![CDATA[<% $title
%>]]></title>
>    <link><% $url %></link>
>    <description><% $elem->get_data('deck')
%><!--more-->
>    <%perl>
>    foreach my $e ($page->get_elements) {
>        if ($e->has_name('paragraph')) {
>    if ($count <= 85){
>           
$m->out('</p><i>'.$e->get_data.'</i>
<p>');
>    }
>    $count += {[split /s+/, $e->get_data]};
>    }}
>    </%perl>
> <br/><br/><a href="<%
$elem->get_data('original_url') 
> %>">Via</a></description>
>    <pubDate><% $doc->get_cover_date('%a, %e
%b %Y %H:%M:%S -0800') 
> %></pubDate>
>    <category><% join('
</category><category> ', map { $_->get_name }

> $doc->get_keywords()) %></category>
>   <% $contributors %>
>  </item>
>
> Thanks,
>
> Wayne
>
> Wayne Slavin wrote:
>> I am working on an XML feed (from the Bricolage.cc
Site Templates) 
>> that I have modified to include some other data. My
goal is to be 
>> able to generate XML feeds for certain categories,
and even the 
>> entire site.
>>
>> I have got it working with limits <= 300. When I
set the limit in the 
>> xml_feed.mc template greater than 300 I get the
following error:
>>
>> An error occurred while processing your request:
>> Can't call method "get_elements" on an
undefined value at 
>>
/usr/local/bricolage/data/burn/comp/oc_1030/output_rss_feed.
mc line 49.
>> Please report this error to your administrator.
>>
>> I think the upper limit for my number of stories is
near the 5000 mark.
>>
>> Can anyone shed some light on this?
>>
>> Regards,
>>
>> Wayne
>>
>

Re: Story->List() Limit Over 300 Errors
user name
2007-03-06 11:31:30
On Tue, 6 Mar 2007, Wayne Slavin wrote:
> %      my $page = $elem->get_container('page');
> %      my $count = 0;
>
> For each story I get the deck and then I have a page
with paragraphs, however 
> using $elem->get_data('page') does not work.
>
> It could be possible, though I don't know for sure that
a page could have 
> only a deck and no page... is this where my problem
might be coming from? How 
> do I deal?

This is very likely the problem.
Print out $story->get_primary_uri and see which one it
is.

You should check all return values like that.
unless (defined $page) {
     $burner->throw_error("You need a page,
foo'!");
}

Re: Story->List() Limit Over 300 Errors
user name
2007-03-06 13:15:38
On Mar 6, 2007, at 08:30, Wayne Slavin wrote:

> For each story I get the deck and then I have a page
with  
> paragraphs, however using $elem->get_data('page')
does not work.

Is page a field or an element? If it's an element,
get_data() (and  
its new name, get_value()), won't work. You can use
get_elements() or  
get_container().

Best,

David

[1-7]

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