Radio weblog calendar bug

| 1 Comment | 1 TrackBack

Every so often, someone will post a question in Radio Userland's discussion forum about the link to the previous month or following month on their weblog's calendar being broken. This always seems to occur on main weblog pages and not category pages.

Julie (Sexy Magick) ran into this problem about a week and a half ago. She had published a post to a category on August 31, but did not publish any posts to her main weblog. This month, the "Aug" link in her main weblog calendar is broken - the link points to the daily archive for Aug. 31 even though Julie did not publish any posts to her main weblog that day.

To figure out why this was occurring, I examined the macro code involved with creating a calendar:

radio.weblog.drawCalendar ()
radio.weblog.getLastPostBeforeDate ()
radio.weblog.getNextPostAfterDate ()

When drawing a calendar, the macro code needs to look at category posts only for a category weblog page calendar, and home page posts only for a main weblog page calendar. The macro code for categories appears to work correctly. However, it is impossible for the macro code for main weblog (home page) posts to work correctly.

In order for these macro to correctly identify home page posts, the macros must look at the flNotOnHomePage field for each post. The getLastPostBeforeDate macro, the getNextPostAfterDate macro, and the code in the drawCalendar macro that creates the previous and next month links do not look at the flNotOnHomePage field at all. Posts that have been posted to a category only and not to the main weblog can be returned by these macros and used as the basis for links on the main weblog calendar when they should not be.

On the last day posts are posted in a given month, if they are all posted to categories and not to the main weblog, the link to that month on the next month's main weblog calendar (the previous month) will be broken.

Similarly, on the first day posts are posted in a given month, if they are all posted to categories and not to the main weblog, the link to that month on the previous month's main weblog calendar (the next month) will be broken.

It is extremely difficult to determine the best way to fix this bug. I do not know if the error is in the fact that getLastPostBeforeDate and getNextPostAfterDate do not look at flNotOnHomePage for home page posts, the fact that drawCalendar does not look at flNotOnHomePage, or both. Nor do I know whether or not a specific fix would break something else in Radio - other functions in Radio may depend on the getLastPostBeforeDate and getNextPostAfterDate macros functioning as they do now. For now, all I can do is report and document the bug.

1 TrackBack

1 Comment

There are two work-arounds for this bug
1) copy another day's file and paste into the same month and change the archive date to the last day of the month which will just show a blank page
2)go back and edit that 8/31 page by adding something to 8/31 post is now a funny 404 error page :)

About this Entry

This page contains a single entry by TweezerMan published on September 25, 2003 9:38 AM.

Setting display colors in Radio's HTML editor - Part 2 was the previous entry in this blog.

New posts up in Radio Userland category is the next entry in this blog.

Find recent content on the main index or look in the archives to find all content.

Powered by Movable Type 6.1.2

MT-Vampire plugin

web hosting by TotalChoice Hosting

Valid XHTML 1.0!
Valid CSS!