We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 37984
    • 215 Posts
    Trying to use the FormitIsSelected and FormitIsChecked snippets included with Formit, and getting the following error anywhere I include a radio button or checkbox in my form:

    Warning: in_array() expects parameter 2 to be array, string given in /site_root/core/cache/includes/elements/modsnippet/38.include.cache.php on line 39


    I am following the instructions outlined in the RTFM to the T, so I'm not entirely sure what the issue is. I found one other person running into this that said it was a bug in the validation, so I turned validation off, and the error is still present. Anyone have any clue what's going on?

    This question has been answered by designcouch. See the first response.

      Jesse Couch
      MODX Aficionado, Front-End Designer & Developer
      http://www.designcouch.com
    • discuss.answer
      • 37984
      • 215 Posts
      I guess I need to read the previous posts before I ask a question that's already been answered. To fix this error, simply go into both of the snippets ( FormitIsChecked and FormitIsSelected ) and replace this:

      if (in_array($options,$input)) {


      with this

      if (!empty($input) && is_array($input) && in_array($options,$input)) {

        Jesse Couch
        MODX Aficionado, Front-End Designer & Developer
        http://www.designcouch.com
      • Check on the GitHub as there are several pull request that address these items. Note of course these are not committed to the extra yet so any future upgrade would loose any of these changes you pull down.

        https://github.com/splittingred/FormIt/pulls

        Cheers
          Evo Revo // Ubuntu, CentOS, Win // Apache 2x, Lighttp (Lighty)
          Visit CharlesMx.com for latest news and status updates.