Hello,

Hopefully the description here is self-explanatory, and hopefully I have not misconfigured something that causes this issue in the first place. From what I can tell, the only thing I've got different is my theme, which shouldn't make a difference here.

You can replicate this (I think) by creating a new topic, then looking at the forum as a different user. A topic with new posts in it has the new post icon, but a new topic without any posts yet does not have the post icon.

I have attached a patch which I used to solve this issue in my own setup; I modify advanced_forum_reply_num_new() to also check if the forum topic node has been viewed, and add that result to what is reported by nodecomment_num_new() or comment_num_new().

If this is not an issue, please, don't let me waste your time. I noticed it on my setup and hopefully this patch will help out.

Comments

rcurtin’s picture

Issue tags: +icon, +topic, +new
michelle’s picture

Version: 6.x-2.0-alpha3 » 6.x-2.x-dev
Status: Needs review » Active
Issue tags: -icon, -topic, -new

I confirmed the bug but don't agree with the solution. I'll dig into this and get it fixed. Thanks for reporting.

Michelle

PS: It's really not necessary to add tons of tags to things. Tags are only needed if you need to make a group of issues, like the set of issues I need to fix before alpha 4. :)

rcurtin’s picture

I see. Unfamiliarity with the codebase led to a git-r-done solution. I can rewrite what I did (since it's a fairly simple patch) if you tell me how it is you want me to do it.

michelle’s picture

Well, the function returns how many new replies there are, so returning 1 new reply when there are no replies but rather an unread starting node doesn't make sense. I checked here on drupal.org and core gets this right so I've been looking at core's code and my code and have some concern about the performance of using this function to control the icon at all and adding an extra query would only add to that. So basically you uncovered a missed symptom of what is potentially a deeper problem and I want to take some time and investigate a better solution to commit to the module.

Michelle

balabushka’s picture

StatusFileSize
new113.34 KB
new97.91 KB

I got a similar problem:

If there is an old topic, but a new comment, on the board overview page, there is no visual sign, that corresponds to that.

michelle’s picture

@balabushka: That's unrelated. Just turn the option on in settings.

Michelle

balabushka’s picture

Gracias! Tbh, the german translation is so bad and incomplete, it was not clear for me!

michelle’s picture

Well, we aren't even in beta, yet, and the strings are far from frozen. I wouldn't expect whoever is translating it to put much time into it yet.

Michelle

a.ross’s picture

sub

meustrus’s picture

Requesting this be pushed to alpha 5, since we have lots of features fully implemented in -dev that aren't in alpha 3 and this isn't close yet.

michelle’s picture

This isn't a feature; it's a bug. So, no, it's not being pushed off.

Michelle

meustrus’s picture

Yeah, but doesn't core forum behave the same way? If you really want to wait until every little misbehavior is fixed, we'll never release anything. I think the proposed behavior makes more sense, but the old behavior is consistent and it's important to get something out there.

michelle’s picture

No, core doesn't have this bug. And, as I said in #4, I have a feeling this is a symptom of a deeper problem. I need to take the time to dig through that old code and make sure I'm not doing something stupid there like I suspect I might be.

I'm not in a rush to release. I'd like to get a new alpha out just to get people to stop using Alpha 3 but this isn't a race. Doing it right is more important than doing it fast.

Michelle

rcurtin’s picture

Let me know if I can be of help here; I can make an attempt to rewrite my patch in the "correct" way (given that I'm informed of what the correct way is).

michelle’s picture

Sorry, rcurtin, I've been really bogged down in another blocker issue that sucked up a good chunk of my last week so haven't been able to dig into this yet. I appreciate the offer but it's not so much that your patch is bad but that it's putting a bandage on a festering wound. I haven't looked at the code in depth, yet, so I could be wrong but I think there's some refactoring needed in there because I don't think I did a good job of it the first time around.

Soon as I get that other issue done, I'll be turning my attention here and getting this fixed up.

Michelle

a.ross’s picture

Test

damienmckenna’s picture

@rcurtin: Just to mention, with Michelle being busy for a little while (see note on the project page), it would help the project a great deal if you could give writing an updated patch a try.

michelle’s picture

Issue tags: +alpha 5 blocker

When I wrote my response in January, I wanted to do it right, not just bandaid it. Given that it is now March and I'm looking at doing a release without this fixed, I'm more responsive to temporary solutions. If you can get me something that's working with the current dev in the next day or so, I'll get it in and save the deeper look until I get back to AF sometime in late April / early May.

Michelle

rcurtin’s picture

I know what it is to be busy so I am glad to help out.

DamienMcKenna: I submitted a patch already, and reading over the comments again I am not seeing any reported issues with that patch, and since I don't have guidance on how to refactor or rewrite it, I don't see what I would change in an updated patch. My patch works, it's just (as noted before) "a bandaid on a festering wound". Tell me how the wound should be fixed and off I go. Otherwise, I've given you my patch already.

damienmckenna’s picture

@rcurtin: no disrespect was intended, I hadn't read the full discussion so was unaware you were waiting on Michelle.

michelle’s picture

I just meant re-rolling against the latest dev since the patch no longer applies.

Michelle

rcurtin’s picture

None taken, just trying to figure out what to do. Later tonight I will update the patch against the latest dev.

rcurtin’s picture

StatusFileSize
new1.08 KB

Updated patch is attached, built against 2.x-dev. Tested to make sure it works alright. Let me know if there are any issues and I will fix them promptly.

michelle’s picture

Version: 6.x-2.x-dev » 7.x-2.x-dev
Status: Active » Patch (to be ported)

Ok, I committed the patch and also made this change in theme.inc:

  // Link to first new post only if the new post isn't the topic starter.
  $variables['first_new_post_link'] = '';
  if ($posts > 1) {
    $variables['first_new_post_link'] = advanced_forum_first_new_post_link($variables['node'], $variables['comment_count']);
  }

Otherwise the header of a new topic had a link to the first new post that was broken since there was no comment ID to link to. I was going to just fix the link but realized having the link there at all was pretty silly in this case.

Sending this over to troky for D7 and then it can be marked fixed. I'm going to start a new issue for the underlying problem rather than totally change this one.

Michelle

michelle’s picture

Issue tags: -alpha 5 blocker

Forgot to detag and also say thanks for the help and patience. :)

Michelle

troky’s picture

Status: Patch (to be ported) » Closed (fixed)

Done.