Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

Replies counter on new posts starts at 1, doesn't increment for 1st reply #1374

Closed
pokrface opened this Issue · 8 comments

2 participants

@pokrface

Using the latest code from the Garden master branch as of this morning, I'm experiencing the following weirdness:

1) User creates a new topic
2) "Replies" counter shows an initial "1" even though there are no replies (presumably this counter cannot show a 0)
3) Discussion appears read from poster's point of view
4) Different user posts first reply to the new topic
5) "Replies" counter does not increment, still shows "1" (there is now 1 actual reply)
5) From discussion starter's point of view, topic is not marked as having any new posts--no "x new" flag, no bolding
6) Discussion starter does receive popup notification of new reply

Part 5 is causing no small amount of community fretting. For what it's worth, the problem only appears to affect each user's own discussions—if user 1 starts a discussion and users 2 & 3 visit it, and user 2 posts a reply, user 3 correctly sees "1 new" on returning (though "replies" still reads "1", having started at 1 and not incremented).

@linc
Collaborator

I actually fixed that within the last week, I think. Did you drop & recreate the database when you reinstalled with the latest code? It's a db structure fix.

@pokrface

Ah, no--I didn't. Was hoping to not have to do that, since the forum is active & has 2-3k posts at this point. If there's a quick fix I can do to the database then I'd love to hear it :)

I know it's offtopic and getting into support territory, and this is exactly what I deserve for testing in production, but any tips on reimporting discussions and user data and private messages and so on if I have to start a new database?

@linc
Collaborator

Generally, you can get database fixes by going to /utility/update after changing the codebase. (Or, /utility/structure if you want to review the changes first). The fix is just to adjust the default for CommentCount on the GDN_Discussion table from 1 to 0, which /utility/update should handle.

@pokrface

Doesn't look like /utility/update did it—/utility/structure just shows the following pending change:

update GDN_User User
set Permissions = ''
where Permissions <> '';

That's okay, though, because I can make the change you mention myself. I see a "CountComments" field with a default "1"—I'm guessing that's the right one. I'll set it to 0.

TYVM for your assistance with this!!

@pokrface

Hmm, this is interesting. When I change CountComments from 1 to 0, /update/structure shows this:



update GDN_User User
set Permissions = ''
where Permissions <> '';

alter table `GDN_Discussion`
/* Existing: `CountComments` int not null default 0, New: `CountComments` int not null default 1 */
change `CountComments` `CountComments` int not null default 1;

Actually letting it run then changes CountComments back to 1.

@linc
Collaborator

Oh, you're using master branch. My bad. This change is on the develop branch and will make it to master probably in under a month.

@pokrface

OK, no problem. I'll just make the change manually and call it done :) Thanks again!!!

@pokrface pokrface closed this
@linc
Collaborator

No problem, thanks for reporting it

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.