Bug: boardindex doesn't show last post from (very) nested board

Started by alkisg, March 10, 2007, 01:56:41 AM

Previous topic - Next topic

alkisg

Can someone confirm (or not!) this bug?
I have a somewhat nested hierarchy:
category1 > board1 > subboard1 > subboard2

The problem is that messages that get posted in subboard2 don't show up in the "last message" paragraph at the bottom of the home screen. They do show up everywhere else though, like, right next to board1 in the home screen, where it says "last message by (user) at (date).

Notice that subboard2 is twice nested (in subboard1 which is a child of board1).

I have SMF 1.1.2 somewhat modded (http://users.sch.gr/alkisg/tosteki). I'd like to know if anyone else sees this bug, so I can start debugging either the core smf or my packages...
Thanks.

P.S. If I go to the control panel and select to recount all statistics, then they do show up correctly on the home screen.

alkisg

Quote from: alkisg on March 10, 2007, 01:56:41 AM
They do show up everywhere else though, like, right next to board1 in the home screen, where it says "last message by (user) at (date).

Sorry, that is incorrect, it only displays correctly in its parent (=subboard1), not in its grandparent (=board1).

I'm thinking the bug is in Subs-post.php, function updateLastMessages.

I started debugging, but I'd appreciate it if someone confirmed the bug...

alkisg


alkisg

The bug was indeed in function updateLastMessages:

Quote
   // Now commit the changes!
   foreach ($parent_updates as $ID_MSG => $boards)
   {
      db_query("
         UPDATE {$db_prefix}boards
         SET ID_MSG_UPDATED = $ID_MSG
         WHERE ID_BOARD IN (" . implode(',', $boards) . ")
            AND ID_MSG_UPDATED < $ID_MSG
         LIMIT " . count($boards), __FILE__, __LINE__);
   }
   foreach ($board_updates as $ID_MSG => $boards)
   {
      db_query("
         UPDATE {$db_prefix}boards
         SET ID_LAST_MSG = $ID_MSG, ID_MSG_UPDATED = $ID_MSG
         WHERE ID_BOARD IN (" . implode(',', $boards) . ")
         LIMIT " . count($boards), __FILE__, __LINE__);
   }

I've replaced the line in bold with

SET ID_LAST_MSG = $ID_MSG, ID_MSG_UPDATED = $ID_MSG


meaning, I made the $parent_updates the same as $board_updates, and everything works OK now.
But I think that a better fix is needed, so it'd be great if someone from the development team had a look at this.

Regards,
Alkis

Max22

Thank you for the fix. It seems work well in 1.1.6.

Max22

Quote from: Max22 on September 11, 2008, 08:07:01 PM
Thank you for the fix. It seems work well in 1.1.6.

My illusion, doesn't solve completely the issue... please search a better fix.

metallica48423

this is not technically a bug, it is completely intentional for performance reasons.

Justin O'Leary
Ex-Project Manager
Ex-Lead Support Specialist

QuoteMicrosoft wants us to "Imagine life without walls"...
I say, "If there are no walls, who needs Windows?"


Useful Links:
Online Manual!
How to Help us Help you
Search
Settings Repair Tool

Max22

Quote from: metallica48423 on September 12, 2008, 03:45:20 PM
this is not technically a bug, it is completely intentional for performance reasons.

If it's intentional, can you give me an help to resolve this particular detail?

Advertisement: