XF 2.2 Radiorow in account preferences (Template modifications) can't be added

Yenxji

Active member
For my add-on developments, I've built everything but there is a problem with radiorow button not being added on XenForo Template Modification causing an error:
Line 78: Tag if contains an unexpected child element. - Template modifications: public:account_preferences

Template modification type:
Public
Template: account_preferences
Modification key: elf_account_preferences
Description: Add option input
Search type: Simple replacement

Find:
Rich (BB code):
<xf:option name="option[content_show_signature]" checked="{$xf.visitor.Option.content_show_signature}"
                    label="{{ phrase('show_peoples_signatures_with_their_messages') }}" />

Replace:
Rich (BB code):
<xf:option name="option[content_show_signature]" checked="{$xf.visitor.Option.content_show_signature}"
    label="{{ phrase('show_peoples_signatures_with_their_messages') }}" />

<xf:if is="$xf.visitor.canViewElfCensoredContent()">
    <xf:formrow label="{{ phrase('option_elfcens_pref') }}"
                explain="{{ phrase('option_elfcens_explain') }}">
        <xf:radiorow name="option[elf_elfcens]">
            <xf:option value="show" 
                      selected="{$xf.visitor.Option.elf_elfcens_show}"
                      label="{{ phrase('elf_elfcens_show') }}" />
            
            <xf:option value="blur"
                      selected="{$xf.visitor.Option.elf_elfcens_show_with_blur}"
                      label="{{ phrase('elf_elfcens_blur') }}" />
            
            <xf:option value="hide"
                      selected="{$xf.visitor.Option.elf_elfcens_hide}"
                      label="{{ phrase('elf_elfcens_hide') }}" />
        </xf:radiorow>
    </xf:formrow>
</xf:if>


src\addons\ELF\ElfCens\XF\Entity\UserOption.php:
PHP:
<?php

namespace ELF\ELFCens\XF\Entity;

class UserOption extends XFCP_UserOption
{
    protected function getDefaultElfCensShow()
    {
        return 0;
    }

    protected function getDefaultElfCensShowWithBlur()
    {
        return 0;
    }

    protected function getDefaultElfCensHide()
    {
        return 1;
    }
}
 
Back
Top Bottom