cforms2
cforms2 copied to clipboard
PHP Notice of lib_render.php
Hi bgermann, I got a php notice in mode:
"Notice: Undefined offset: 1 in [mypath]/plugins/cforms2/lib_render.php on line 752"
Just put on emore conditional to it, removes it
if (isset($radioPreset[1]) && strpos($radioPreset[1], 'true') !== false)
...using development version, downloaded master today.
I got some more notices on another form:
Notice: Undefined index: cforms2_count_field_19 in [mypath]/plugins/cforms2/lib_validate.php on line 489
when I put this condition in line 488:
if (!$custom && isset($cformsSettings['form' . $no]['cforms' . $no . '_count_field_' . $i]))
it results in another notice:
Notice: Undefined offset: 18 in [mypath]/plugins/cforms2/lib_validate.php on line 491
But I don't have a patch for that now. Just inserting more conditions results in memory exhausted.
Btw please don't forget to tell your users on the next update, that they have to save the forms again, and have to re-insert them via the editor button or shortcode.
How many fields do you have in the form that you referenced in your 2nd post? I guess you have 18 fields.
exactly
ok, coming back to this issue, in current version 15.0.3. I solved it by changing lines 422-431 in lib_validate.php to:
if (!$custom && isset($cformsSettings['form' . $no]['cforms' . $no . '_count_field_' . $i])) {
$field_stat = explode('$#$', $cformsSettings['form' . $no]['cforms' . $no . '_count_field_' . $i]);
$field_stat[] = "";
} elseif(isset($customfields[$i - 1])) {
$field_stat = explode('$#$', $customfields[$i - 1]);
$field_stat[] = "";
} else {
// all fields searched, break both while & for
break 2;
}