Closed (fixed)
Project:
Advanced Forum
Version:
6.x-2.x-dev
Component:
Code
Priority:
Major
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
26 Apr 2011 at 04:11 UTC
Updated:
17 Sep 2011 at 23:51 UTC
Jump to comment: Most recent file
Comments
Comment #1
rcurtin commentedSorry, mistype. The referenced issue is #1044322: A new topic with no comments does not show new post icon (now you get a nice link).
Comment #2
michelleLOL! I was about to take you to task for being so nasty to someone who was nice enough to write a patch... Maybe I should still do that, actually. Not nice to be so nasty to the poor fellow who made a simple mistake. :)
Thanks for the update. Having company for a week (my office is the guest room) has really put me behind and I'm not in a position to apply this right now since my dev environment is messy. Will get to it ASAP, though.
Michelle
Comment #3
mcdruid commentedThanks rcurtin - could you check that this patch really is necessary against the latest 6.x-2.x-dev though please?
It's taken me a little while to work out what's going on; I think Michelle has committed your patch from #1044322 but that it didn't include the stuff you're now removing in your new patch.
I could be wrong, but I don't actually think we need to worry about this as the code you want to remove is not actually there in the branch.
Let me know if I've got the wrong end of the stick.
Comment #4
michelleYeah, I never did anything on this issue. I pretty much missed the entire month of May due to being ill and never really got back into AF before switching gears to Artesian.
Michelle
Comment #5
rcurtin commentedSorry for the delay -- life happened (I hate that!). This is still necessary against the latest 6.x-2.x-dev; or, that is what I am experiencing, having upgraded to a clean 6.x-2.x-dev and seeing the same issues, with old posts being marked new.
Comment #6
rcurtin commentedAh, the old patch doesn't work anymore. I've updated it for great justice.
Comment #7
mcdruid commented@rcurtin - no problem, I've had quite a lot of life happening recently too!
I'm still a bit confused about what's going on here. AFAICS your (updated) patch is trying to remove lines which are not there in the 6.x-2.x branch:
patch:
6.x-2.x branch / current dev release:
So unless I'm missing something, I don't see that your patch is necessary, nor will it actually apply to the branch or the dev release (dated 2011-Aug-02 at the moment).
Comment #8
rcurtin commentedThe patch was created backwards by accident, but read it again with the +s and -s and vice versa. patch will happily take this and apply it correctly, though (try it if you like).
Here is a further description of the bug and why the patch is necessary. At some point in printing out all the topics (or forums), we must decide if each one has anything new in it or not, so we know which icon to use (no new posts / new posts). Before #1044322: A new topic with no comments does not show new post icon was fixed, the code simply checked to see if there were new comments or nodecomments, based on which the forum itself was using. However, the code did not check to see if the original forum post (not the comments) had been viewed, and #1044322: A new topic with no comments does not show new post icon fixed that.
Now, this introduced another issue. The node_last_viewed($nid) call will return 0 if there is no record in {history} of the node being viewed. {history} is clobbered by cron regularly, removing all history entries older than NODE_NEW_LIMIT. As a result, what happens is that posts older than NODE_NEW_LIMIT are marked as new (again because node_last_viewed($nid) return 0 since the record of its viewing in {history} has been removed).
So, in the end, the best decision is to check if the node was modified before NODE_NEW_LIMIT (meaning that a view could possibly have been deleted from {history}), and if it was modified before then, we say it was already viewed. Yes, it is possible that we could mark a very old post that a user has never seen as viewed, but, this is the price paid to keep {history} small. There is not a good, space-efficient solution to keeping completely accurate node viewing data, and inside of the current framework, this is the best we can do. Even if we did add another table to keep track of forum history losslessly, now we have another big table (because it's not going to be small).
Is this enough information or should I add more to the dissertation here? You can try this yourself but you need a forum with posts older than NODE_NEW_LIMIT and then you need to run cron to remove old things from {history}.
Comment #9
mcdruid commentedrcurtin, thanks for your patch and your excellent dissertation.
However, I can only give you an A- because of the backwards patch :-)
Committed to 6.x-2.x branch.
Comment #11
finex commentedI want to report that the patch is not available on http://drupal.org/node/438698 (current -dev version) and in the current git repo.
Comment #12
finex commentedComment #13
mcdruid commentedare you sure about that? I've just checked advanced_forum-6.x-2.x-dev which is currently dated Aug 12th 2011, and the git repo, and I believe the changes are there in both.