Help - Search - Members - Calendar
Full Version: Daily Archives List Lastn Bug In Mt 3.2
Movable Type Community Forum > Other Product Discussion > Bugs and Odd Behavior
FiReaNG3L
Odd bug where the count for lastn seem to go by a factor of 3.

MTArchiveList archive_type="Daily" lastn="x"

Previously, x would display x entries.

Now, to display 3 entries, you must type lastn="9".
To display 5 entries, x must be 15, etc.

Very weird, reproducible (at least in my blog).
Annoying Old Guy
Yes, I noticed this with monthly archives where I had to use lastn="36" instead of 12. I looked at the code and it looks like just some very sloppy coding.

This is in lib/MT/Template/ContextHandlers.pm in the method _hdlr_archives. Around line 2163, there's a while loop that creates the output. The variable $i tracks the number of things generated and is compared against $n (the value of the attribute "lastn"). However, note that $i is incremented three separate times (lines 2165, 2167, and 2184) in the loop, once by itself and both times when it's compared to $n. My recommendation would be to remove increments from the comparison.
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2008 Invision Power Services, Inc.