1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Fixed Probably typos in the Discussion DataWriter

Discussion in 'Resolved Bug Reports' started by sonnb, Apr 20, 2015.

  1. sonnb

    sonnb Well-Known Member

    At the line 963:
    $visibleMessageIds = array();
    $nonVisibleMessageIds = array();
            foreach (
    $messages AS $messageId => $message)
                if (empty(
    $message['message_state']) || $message['message_state'] == 'visible')
    $visibleMessageIds[] = $messageId;
    $nonVisibleMessageIds[] = $messageId;
    $messageContentType$visibleMessageIds, ($this->get('discussion_state') == 'visible')
    I guess the second call should be $nonVisibleMessageIds instead of $visibleMessageIds
    Daniel Hood likes this.
  2. imthebest

    imthebest Formerly Super120

    How does this bug affects people in the practice? I mean what is the payload of this bug?
  3. Amaury

    Amaury Well-Known Member

    There are many "bugs," like most of mine, that don't really affect anyone (e.g., having something be changed to title case), but that doesn't mean they shouldn't be changed.
  4. Daniel Hood

    Daniel Hood Well-Known Member

    Actually this one seems like it does affect things. This seems to not delete likes for content that isn't visible (soft deleted content and moderated content).

    I should add that this is only called when a thread is hard-deleted. So, if a moderator hard deletes a thread that has soft-deleted or moderated messages, that received likes, those likes won't be removed.
    Amaury and imthebest like this.
  5. imthebest

    imthebest Formerly Super120

    Daniel let me see if I understood it correctly, not exactly related to this bug but it's similar:

    For example if I post something and this post receives 10 likes, if my post gets soft deleted, will those 10 likes get lost? I mean if later my post gets restored it will have 0 likes?
  6. Daniel Hood

    Daniel Hood Well-Known Member

    No. Let's say your post and my post both get 10 likes. If your post gets soft deleted or put into moderation to where it's not visible, and then the thread gets hard-deleted, the 10 likes on my post will get deleted and the 10 on your post won't. That's what this bug is.

    P.S. if you ever have a post with 10 likes, you can assume that's a bug as well :p
  7. sonnb

    sonnb Well-Known Member

    Just minor issue. It does not affect your content directly. Just the orphaned records remain in your database.
    Daniel Hood and imthebest like this.
  8. Mike

    Mike XenForo Developer Staff Member

    Good catch. :) Fixed now, thanks.
    sonnb and Amaury like this.

Share This Page