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

Fixed Unused set var in permission_user_group_edit - would actually be useful!

Discussion in 'Resolved Bug Reports' started by Chris D, Sep 29, 2013.

  1. Chris D

    Chris D XenForo Developer Staff Member

    In permission_user_group_edit the permission_check_all template is included, and a $target var is set, even though it isn't used in permission_check_all. (Excuse the WebDAV syntax):

    HTML:
            <link rel="xenforo_template" type="text/html" href="permission_check_all.html">
                <xen:set var="$target">#piGroups</xen:set>
            </link>
    The permission_check_all template does not use the $target variable, the target is hard coded:

    HTML:
    <th class="option {$key}"><label class="CheckAll" data-target="#piGroups input:radio[value={$key}]">{$value}</label></th>
    So a solution could be just to remove the <xen:set var line and leave things as they are. Though a more useful solution would be to change the block of code above in the permission_check_all template to:

    HTML:
    <th class="option {$key}"><label class="CheckAll" data-target="{$target} input:radio[value={$key}]">{$value}</label></th>
    That would then allow us to re-use that template for other things... such as custom permissions pages.
     
    SneakyDave and Jeremy like this.
  2. Mike

    Mike XenForo Developer Staff Member

    I'm now using:
    Code:
    {xen:if $target, $target, '#piGroups'}
    Which should maintain backwards compatibility (provided $target isn't being set somewhere...)
     
    SneakyDave likes this.

Share This Page