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

Fixed Super minor issue (and easy to fix, please read)

Discussion in 'Resolved Bug Reports' started by xfrocks, Apr 16, 2011.

  1. xfrocks

    xfrocks Well-Known Member

    This one is really small but it bugged me quite a lot.

    XenForo 1.0.1 (actually, all version)
    Class: XenForo_Template_Helper_Core
    Line: 1458

    return "<a{$href} class=\"avatar Av{$user[user_id]}{$size}{$class}\"{$attribs} data-avatarHtml=\"true\">{$image}{$content}</a>";
    Sometime, this line will cause an exception like this

    An exception occurred: Use of undefined constant user_id - assumed 'user_id' in ...\library\XenForo\Template\Helper\Core.php on line 1458
    It doesn't happen all the time but please fix, either this

    return "<a{$href} class=\"avatar Av{$user['user_id']}{$size}{$class}\"{$attribs} data-avatarHtml=\"true\">{$image}{$content}</a>";
    Or this will do

    return "<a{$href} class=\"avatar Av$user[user_id]{$size}{$class}\"{$attribs} data-avatarHtml=\"true\">{$image}{$content}</a>";
    Thank you
    krstep and Vincent like this.
  2. Mike

    Mike XenForo Developer Staff Member

    I'm actually quite confused as to why that hasn't come up before - the code should always be hit. Regardless, fixed. :)
    xfrocks likes this.
  3. xfrocks

    xfrocks Well-Known Member

    Thank you! I wondered that too since XenForo tries to catch all errors. Strange things happen I guess :D

Share This Page