[MODDB] mod to preserve global unread flags

A place for MOD Authors to post and receive feedback on MODs still in development. No MODs within this forum should be used within a live environment!
Anti-Spam Guide
Locked
asinshesq
Registered User
Posts: 6266
Joined: Sun Feb 22, 2004 9:34 pm
Location: NYC
Name: Alan

[MODDB] mod to preserve global unread flags

Post by asinshesq »

Author: asinshesq

Modification Description:: This mod fixes a phpbb3 bug that causes unread global announcements to lose their unread status whenever the user reads all the unreads in a given forum or posts any new posts or replies ( see http://www.phpbb.com/bugs/phpbb3/15729 ).

Modification Version:: 0.0.1a

PHPBB3 has a bug that causes unread global announcements to lose their unread status whenever the user reads all the unreads in a given forum or posts any new posts or replies ( see http://www.phpbb.com/bugs/phpbb3/15729 ).

The following is an alpha version of a mod that fixes this problem. I have tested this a fair bit on a test board and it seems to work, but I do not have a live phpbb3 board (my live boards are still on phpbb2) so I haven't yet used it in a live environment. If you give this a try, please let me know how it goes.

[ code replaced by newer version here: http://asinsh.com/phpbbmods/preserve_gl ... _flags.zip ]

By the way, if a user edits a regular post and turns it into a global or vice versa, the unread status of that post will not be treated correctly. That's not because of this mod but rather is because of another phpbb3 bug that causes a topic's unread flag status to get messed up when the topic is moved from one forum to another.
Last edited by DavidIQ on Tue Jan 27, 2009 1:48 am, edited 3 times in total.
Reason: Locked topic

asinshesq
Registered User
Posts: 6266
Joined: Sun Feb 22, 2004 9:34 pm
Location: NYC
Name: Alan

Re: [BETA] mod to preserve global unread flags

Post by asinshesq »

I just posted a new version that you can download here: http://asinsh.com/phpbbmods/preserve_gl ... _flags.zip

There are no material changes. I cleaned up the code slightly and packaged it as a more official looking mod. I've gone ahead and changed the designation to beta since it seems to work fine on my test board and no one has reported any problems yet. Please post here with any problems or questions.

asinshesq
Registered User
Posts: 6266
Joined: Sun Feb 22, 2004 9:34 pm
Location: NYC
Name: Alan

Re: [BETA] mod to preserve global unread flags

Post by asinshesq »

I just uploaded a fully packaged version that now has a modx install file, so you can isntall this with automod if you want to give it a try. Same link as in the prior post...

asinshesq
Registered User
Posts: 6266
Joined: Sun Feb 22, 2004 9:34 pm
Location: NYC
Name: Alan

Re: [RC] mod to preserve global unread flags

Post by asinshesq »

I just changed this to RC but it's the same version as before. I will submit this for validation some time over the next week.

asinshesq
Registered User
Posts: 6266
Joined: Sun Feb 22, 2004 9:34 pm
Location: NYC
Name: Alan

Re: [RC] mod to preserve global unread flags

Post by asinshesq »

I went ahead and submitted this for validation. Hopefully it will get through in a few weeks.

demon327
Registered User
Posts: 847
Joined: Thu Nov 16, 2006 2:16 pm

Re: [RC] mod to preserve global unread flags

Post by demon327 »

Why make a mod of this? just submit the bug again in the bug tracker ;)

asinshesq
Registered User
Posts: 6266
Joined: Sun Feb 22, 2004 9:34 pm
Location: NYC
Name: Alan

Re: [RC] mod to preserve global unread flags

Post by asinshesq »

demon327 wrote:Why make a mod of this? just submit the bug again in the bug tracker ;)
Three reasons:

1. The bug is not a subtle one the developers missed. It is there by design. The developers who wrote the code for tracking unreads purposefully wrote code to wipe out global unread flags whenever the user reads his last unread post of a forum or posts a new post, and the code and comments they wrote make this totally clear. I suspect they made a choice to do that to avoid the additional resource overhead it would have taken to treat globals just like any other forum, since regular boards rarely will have new global posts anyway. So I would not be surprised if they choose not to fix the bug.

2. It is possible (not likely but possible ;) ) that I thought of an approach for fixing the bug that is efficient enough so that they might change their minds and adopt something like my fix. So submitting the full code as a mod and having people test it out could convince the developers to fix a bug they were otherwise going to leave alone (and give them a starting place when they write their own fix). Of course it's also completely possible that my approach sacrifices something the developers don't want to sacrifice, or introduces a new bug that is worse than the original bug. The comments I get during validation should be interesting.

3. I wanted to fix this bug in a validated way so that I could use the fix for another mod of mine that deals with unread flags generally (my view or mark unread posts mod). Some users had reported that my mod didn't work correctly for globals and they were right, but the reason it didn't work correctly on globals was because of this bug.

Has anyone tried this yet on their boards?

User avatar
DavidIQ
Customisations Team Leader
Customisations Team Leader
Posts: 17114
Joined: Thu Jan 06, 2005 1:30 pm
Location: Fishkill, NY
Name: David Colón
Contact:

Re: [RC] mod to preserve global unread flags

Post by DavidIQ »

I think you should have just made it part of your mod as you're now creating a dependency on another mod for it to work.
Apply to become a Jr. Extension Validator
My extensions | In need of phpBB services? | Was I helpful today?
No unsolicited PMs unless you're planning on asking for paid help.

asinshesq
Registered User
Posts: 6266
Joined: Sun Feb 22, 2004 9:34 pm
Location: NYC
Name: Alan

Re: [RC] mod to preserve global unread flags

Post by asinshesq »

DavidIQ wrote:I think you should have just made it part of your mod as you're now creating a dependency on another mod for it to work.
Hi, David.

There is no dependency...the view or mark unread posts mod works without this mod and vice versa. They are doing different things.

User avatar
DavidIQ
Customisations Team Leader
Customisations Team Leader
Posts: 17114
Joined: Thu Jan 06, 2005 1:30 pm
Location: Fishkill, NY
Name: David Colón
Contact:

Re: [RC] mod to preserve global unread flags

Post by DavidIQ »

Reason I said it was because of this:
asinshesq wrote:3. I wanted to fix this bug in a validated way so that I could use the fix for another mod of mine that deals with unread flags generally (my view or mark unread posts mod). Some users had reported that my mod didn't work correctly for globals and they were right, but the reason it didn't work correctly on globals was because of this bug.
But if that mod isn't going to be dependent on this mod then that's fine.
Apply to become a Jr. Extension Validator
My extensions | In need of phpBB services? | Was I helpful today?
No unsolicited PMs unless you're planning on asking for paid help.

asinshesq
Registered User
Posts: 6266
Joined: Sun Feb 22, 2004 9:34 pm
Location: NYC
Name: Alan

Re: [RC] mod to preserve global unread flags

Post by asinshesq »

DavidIQ wrote:Reason I said it was because of this:
asinshesq wrote:3. I wanted to fix this bug in a validated way so that I could use the fix for another mod of mine that deals with unread flags generally (my view or mark unread posts mod). Some users had reported that my mod didn't work correctly for globals and they were right, but the reason it didn't work correctly on globals was because of this bug.
But if that mod isn't going to be dependent on this mod then that's fine.
Neither is dependent on the other...they deal with different things. Howveer, users who install my view or mark unread posts mod are users who are focused on unread flags, and they may be the same kind of users who are bothered by the irratic way phpbb3 deals with global unread flags. (In the topic for my view or mark unread flags mod a few users had pointed out the problem, mistakenly thinking it was caused by my mod, so I wanted to give those people a fix.)

asinshesq
Registered User
Posts: 6266
Joined: Sun Feb 22, 2004 9:34 pm
Location: NYC
Name: Alan

Re: [RC] mod to preserve global unread flags

Post by asinshesq »

This mod is now validated. Any further discussion about it should be in this topic: http://www.phpbb.com/community/viewtopi ... &t=1430485

Locked

Return to “[3.0.x] MODs in Development”