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

Fixed FieldAdder js Clone bug

Discussion in 'Resolved Bug Reports' started by Uniphix, Mar 11, 2014.

  1. Uniphix

    Uniphix Active Member

    I am using the FieldAdder part of the XenForo.js script. Now when I add a SpinBox into the FieldAdder to clone it will create multiple +/- when it should only create it once, the first +/- works fine but the others which shouldn't be there are appearing.

    Now I can hotfix it on my end with no problem, but for me to update I would have to add it everytime.

    Find where it says $clone = $source.last().clone(); and either before or after the disable button, clearing values etc. add

  2. Mike

    Mike XenForo Developer Staff Member

    This is really one specific case of a fairly generic problem. I think changing this properly would involve changing the way the template entry is defined.

    That said, I have tweaked this case. Note that you can listen for the FieldAdderClone event and manipulate the clone before it's inserted.
    Fuhrmann likes this.
  3. Uniphix

    Uniphix Active Member

    Oh, well that is a good thing I didn't even think to see that. Thanks Mike for fixing it. Now that I see that it will help with some other areas, such as I may need to do some specific indexing rather than having something like parameters[$index][name] parameters[$index][type] etc. if I needed to now knowing about that event I can be able to do more :).

    But again thanks for fixing this!

Share This Page