Bug Report: Empty form fields are not in $_POST = error in render-form.php
Viewing 2 Posts - 1 through 2 (of 2 total)
Author | Posts |
---|---|
September 9, 2013 at 3:08 am 7937 | |
Tareq Hasan | WP User Frontend Pro (v2.1.7)
WordPress (v3.6)
Summary: PHP Notice due to Undefined index stalls AJAX.
Where: function prepare_meta_fields() in class/render-form.php
To reproduce:
[Sun Sep 08 15:49:40 2013] [error] [client 127.0.0.1] PHP Notice: Undefined index: my_checkbox in /Users/bpk/Sites/local.wordpress.dev/public/wp-content/plugins/wp-user-frontend-pro/class/render-form.php on line 211, referer: http://local.wordpress.dev/wpuf-profile-form-field-tests/?msg=profile_update [Sun Sep 08 15:49:40 2013] [error] [client 127.0.0.1] PHP Notice: Undefined index: my_checkbox in /Users/bpk/Sites/local.wordpress.dev/public/wp-content/plugins/wp-user-frontend-pro/class/render-form.php on line 214, referer: http://local.wordpress.dev/wpuf-profile-form-field-tests/?msg=profile_updateDetails: If a checkbox field is NOT required, the Edit Profile form can be submitted without any selected (checked) options. With no options checked, $_POST does not include this checkbox field as an index in the array.
In class/render-form.php , the prepare_meta_fields function loops over ALL the fields defined in the form, but on Line 211 we get an error because the checkbox field name is not in $_POST .
$_POST[$value['name']]
$_POST['my_checkbox' ] is not set. |
September 9, 2013 at 3:47 am 7941 | |
lfd | Sorry, I shouldn’t have noted that this only stalls AJAX when |
September 9, 2013 at 7:26 am 7943 | |
Tareq Hasan | Hello Brian, thats a great bug report. Not that the bug is great, but the report is 🙂 Obviously that’ll only work when |
Viewing 2 Posts - 1 through 2 (of 2 total)