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

Not a Bug PHP Callback for options

Discussion in 'Resolved Bug Reports' started by Aayush, Feb 4, 2014.

  1. Aayush

    Aayush Well-Known Member

    I just realized this issue when I was coding this plugin.


    So I was coding this and I encountered an issue while saving the options.
    I use a callback for providing the options. I use the xenforo class to get all the groups present. Then I render them in checkboxes using a prebuilt xenforo template.
    It works fine till here.
    I also use a custom validation of options.
    In that I call a function from the model which updates stuff. I am not using any data writer here, just for simplicity sale.

    Now whenever I change the select boxes input, I.e. I change the groups allowed within in admin area, and hit save. It saves but the function in model isn't called on validation.
    Now when I hit save again without changing the select options, the function in model get called.
  2. Mike

    Mike XenForo Developer Staff Member

    I'm unable to reproduce this. The validation is called whenever the option's value appears to change for me. Can you provide a reduced test case? (Ideally just the option and the validation code and the steps to reproduce it not being called when expected.)
  3. Aayush

    Aayush Well-Known Member

    I'll make a video and upload it tomorrow so that you can take a look. Would that be fine?
  4. Mike

    Mike XenForo Developer Staff Member

    It may help, but an isolated reproduction case (with code) would be ideal.
  5. Aayush

    Aayush Well-Known Member

    Hope this helps. If you want the code in hardCacheReset(), I can give that as well, but I don't think you'll require that(Its just some basic insertion into DB).
  6. Nobita.Kun

    Nobita.Kun Well-Known Member

    I think this is bug of your mod rather of XenForo.
  7. Aayush

    Aayush Well-Known Member

    Looks like I am getting options before they are getting saved.

    Sorry the issue was on my end.
    Please mark as resolved.
    Last edited: Feb 8, 2014

Share This Page