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

Fixed Copying and Pasting @Tags does not alert user

Discussion in 'Resolved Bug Reports' started by Divvens, Jul 18, 2013.

  1. Divvens

    Divvens Well-Known Member

    I had this issue come up recently on my board using the [bd]Tag add-on, I tested to see if this is a issue with xF core tagging as well, it seems it is. I have tested it in this test thread with an account of my friend (to which I have access as well) - http://xenforo.com/community/threads/testing-tagging.55122/

    If a tag is copied and pasted, it does not alert user.
    If you type in @Freeze, it would alert the user. But if you copy and paste the tag (say from another post) the @tag doesn't alert the user, since the username is considered a "hyperlink" and it doesn't turn into the user BB code that is produced from tagging.

    To reproduce:
    1. Tag a user. Check the tagged account for alert.
    2. Copy and paste the tag, user is not alerted for that tag.

    Clicking "edit" on the 2nd message also shows that the tags aren't converted to the user BBCode.

    This issue came up in a thread where the thread starter would require to tag (and alert) a set of users frequently, the thread starter kept copying and pasting the tags until the users reported not being alerted by the tags. Sometimes, if multiple users need to be tagged frequently (with the lack of group tagging) people usually copy/paste.
     
  2. Jeremy

    Jeremy XenForo Moderator Staff Member

    The copy & paste copies the user hyperlink correctly and it gets converted into a code correctly.
     
  3. Divvens

    Divvens Well-Known Member

    It gets converted into
    Code:
    [url=link]Username[/url]
    That is what I meant, copying and pasting the username with the tag pastes it as a URL and when the post is made, it is retained as a URL and not as a tag. I.E, the @USERNAME does not turn into
    Code:
    [USER=9157]Freeze[/USER]
    When copied and pasted. Thus not generating a alert if "@Freeze" is copied and pasted.
     
  4. Jeremy

    Jeremy XenForo Moderator Staff Member

    A user isn't alerted with direct use of the user tag, @Divvens (or so I believe. I may be wrong here). However, this may be an edge case where the editor could pick it up and remove the URL and USER tag completely, leaving a plain tag.
     
  5. Divvens

    Divvens Well-Known Member

    I am aware that the user BBCode aren't the ones that generate an alert, but typically, if I type in @King Kovifor it turns into
    Code:
    [user=81]King Kovifor[/user]
    I was using that as an example to show that when @King Kovifor is copied and pasted, it is just copied as a URL, and once the post is made, it is retained as a URL rather than being converted to a tag that should alert the user. And this can be seen when "editing" the copied and pasted tag, since the username is now in URL parameters and not in user bbcode parameters.
     
    Jeremy likes this.
  6. Mike

    Mike XenForo Developer Staff Member

    Correct, this is what it would need to do.
     
    Divvens and Jeremy like this.
  7. Jeremy

    Jeremy XenForo Moderator Staff Member

    I realize how that last post could have sounded slightly rude. I apologize if it came off that way, wasn't meant to be. Was just attempting to explain the programming logic behind it. How you copy a URL (a tag) so the editor correctly converts it to URL tag and commenting on how converting it to the USER tag wouldn't work the way you intended it to. My last line (as Mike quoted) is the "solution" where this edge case would need to strip the URL completely to leave it as "@King Kovifor" for it to work as a new tag.
     
    Divvens likes this.
  8. Divvens

    Divvens Well-Known Member

    Hey hey, I didn't take it rudely and you don't need to apologize! :p
    I'm a noob when it comes to programming, I did however understand that you posted a solution when you spoke about leaving a plain tag. I was just trying my best to explain in my own terms the issue :D You weren't rude or anything. Infact, if I sounded rude with my reply forgive me, I was under the misunderstanding that you hadn't understood the original problem I was reporting (after re-reading your post, I see that you did actually understand it) :)

    I've also come across another bug which I shall now report in another thread!
     
    Jeremy likes this.
  9. Mike

    Mike XenForo Developer Staff Member

    I've adapted the output a bit and this should work in the overwhelming majority of cases where this may happen. Strictly speaking, the [user] tag can have any content -- we don't actually know the user's name. If someone has changed that, then this will fail (in terms of the alert, the paste will still work).

    But that should be an absolute edge case.
     
    Divvens, Jeremy and Martok like this.

Share This Page