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

AutoValidator and uploadunit

Discussion in 'XenForo Development Discussions' started by silence, Jul 14, 2015.

  1. silence

    silence Well-Known Member

    Ok so I have an admin template as so:

    Code:
    <xen:form action="{xen:adminlink 'users/avatar-upload', $user}" upload="true">
        <xen:uploadunit label="{xen:phrase upload_avatar}:" name="avatar" />
    
        <xen:submitunit save="{xen:phrase modify_avatar}" />
    </xen:form>
    That works just fine. Now if you add to xen:form
    Code:
    class="AutoValidator"
    You get this error:
    Code:
    The field 'avatar' was not recognised.
    Alright fine. Now if I try to add to xen:uploadunit
    Code:
    class="OptOut"
    it still spits out avatar as false.

    Will I not be able to use an upload unit with the autovalidation feature?

    Thanks!
     
  2. Chris D

    Chris D XenForo Developer Staff Member

    The particular error you're getting sounds like you're attempting to set a value on a field using the DataWriter that doesn't exist.

    It is quite likely, though, that file uploads in this way are unlikely to work unless you have additional code to support it, hence I've moved this from bugs.
     
  3. Mike

    Mike XenForo Developer Staff Member

    This is correct. AutoValidators don't support uploads.
     
  4. silence

    silence Well-Known Member

    Will that ever change, or should I just move my upload form to a new route?
     
  5. Mike

    Mike XenForo Developer Staff Member

    It's probably somewhat unlikely to change, at least in a short enough term to be relevant to something you're developing right now.
     
    silence likes this.

Share This Page