Hi!
I am using formit for my contacts. I have a selector.
In the html output I am getting an error like:
Warning: in_array() expects parameter 2 to be array, string given in .../htdocs/cms/core/cache/includes/elements/modsnippet/12.include.cache.php on line 39
the code from the file 12.include.cache.php:
$output = ' ';
if ($input == $options) {
$output = ' selected="selected"';
}
$input = $modx->fromJSON($input);
if (in_array($options,$input)) {
$output = ' selected="selected"';
}
return $output;
}
The formular works so far using this code in the chunk:
<option value="demo1" [[!+fi.thema:FormItIsSelected=`demo1`]] >demo1</option>
<option value="demo2" [[!+fi.thema:FormItIsSelected=`demo2`]] >demo2</option>
<option value="demo3" [[!+fi.thema:FormItIsSelected=`demo3`]] >demo3</option>
<option value="demo4" [[!+fi.thema:FormItIsSelected=`demo4`]] >demo4</option>
It's working so far - but I don't know why I am getting this errors. Has it maybe something to do with the php version?
Or Javascript?
[[!FormIt?
&hooks=`email,redirect`
&emailTpl=`email.pro.tpl`
&emailTo=`[email protected]`
&redirectTo=`5`
&emailSubject=`New message`
&validate=`
name:required,
email:required,
subject:required,
workemail:blank,
text:required:stripTags`
]]
I also deleted the whole core/cache folder - but the same happened again.
When I switch to php 5.2 I have the "array" error directly in the frontend.
Thanks for any infos!
AD
[ed. note: ad2003 last edited this post 11 years ago.]