I discovered this in the Weblog Module: limit wasn’t being respected because $this->limit was being used instead of $this->p_limit. I’ve attached a diff for review.
This is an archived forum and the content is probably no longer relevant, but is provided here for posterity.
The active forums are here.
July 27, 2010 5:14pm
Subscribe [4]#1 / Jul 27, 2010 5:14pm
I discovered this in the Weblog Module: limit wasn’t being respected because $this->limit was being used instead of $this->p_limit. I’ve attached a diff for review.
#2 / Jul 27, 2010 8:19pm
Aaron,
Which build are you using? Can you show us a bit of template code that reproduces the problem?
#3 / Jul 27, 2010 8:30pm
Hey Brandon, thanks for the quick reply.
Build: 20100415
{exp:weblog:entries weblog="calendar" show_future_entries="yes" limit="{embed:limit}"
category="{embed:category_id}"
start_on="{embed:start}" stop_before="{embed:end}"
orderby="date" sort="asc" dynamic="off" sticky="{embed:sticky}"
disable="categories|category_fields|member_data|pagination|trackbacks"}
{!-- other stuff here --}
{/exp:weblog:entries}When supplying anything over 100 it wasn’t triggering the value (say 500 or 1000) to be passed into the SQL. I traced it back to that line.
#4 / Jul 28, 2010 2:51am
Aaron,
Can you create a blank template and just add the following
{exp:weblog:entries weblog="calendar" show_future_entries="yes" limit="500" orderby="date" sort="asc" dynamic="off"}
{!-- other stuff here --}
{/exp:weblog:entries}
Switch on Display SQL Queries?
CP Home › Admin › System Preferences › Output and Debugging Preferences
Now look for your your weblog query. See attached for mine. You can see the limit being passed here. Do you see the same?
Note that you are a build behind but I still have that same line in mod.weblog.php
#5 / Jul 28, 2010 8:42am
It’s being passed in, even when I revert the file.
SELECT t.entry_id FROM exp_weblog_titles AS t LEFT JOIN exp_weblogs
ON t.weblog_id = exp_weblogs.weblog_id LEFT JOIN exp_members AS m
ON m.member_id = t.author_id WHERE t.entry_id !='' AND t.site_id IN ('1')
AND (t.expiration_date = 0 OR t.expiration_date > 1280331287) AND
exp_weblogs.is_user_blog = 'n' AND t.weblog_id = '4' AND t.status = 'open'
ORDER BY t.sticky desc, t.entry_date asc, t.entry_id asc LIMIT 0, 500Perhaps there was something else amiss that I changed at the same time that caused this issue, but I could have sworn even hard-coding in the limit wasn’t making it work. Odd.
Apologies for wasting your time.
#6 / Jul 28, 2010 9:03am
No worries. Glad you were able to figure out what the problem is. Don’t hesitate to post again as needed.