FiReaNG3L
Aug 25 2005, 09:02 PM
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
Aug 29 2005, 03:54 PM
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.