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

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.
 
I'm now using:
Code:
{xen:if $target, $target, '#piGroups'}
Which should maintain backwards compatibility (provided $target isn't being set somewhere...)
 
Back
Top Bottom