Fixed edit_history_view template ignores canRevert permission

Rigel Kentaurus

Well-known member
You might have figured by now that I am working to integrate Edit History in my own add-on :)

Anyway, the controller
XenForo_ControllerPublic_EditHistory.actionView
correctly sets as a view parameter
Code:
    'canRevert' => $handler->canRevertContent($content)

But this is ignored in the template, which displays the "Revert" button regardless
Code:
    <form action="{xen:link edit-history/revert, $history}" method="post" class="sectionFooter">
        <label><input type="checkbox" name="_xfConfirm" value="1" /> {xen:phrase confirm_revert}</label>
        <input type="submit" class="button" value="{xen:phrase revert_to_this_version}" />
        <input type="hidden" name="_xfToken" value="{$visitor.csrf_token_page}" />
    </form>

A <xen:if is="{canRevert}"> looks needed :)
 
Last edited:
Top Bottom