WPUF form settings become empty after adding new fields — Undefined array
-
Title: WPUF form settings become empty after adding new fields — Undefined array key
submit_textEnvironment
- WordPress running locally on WAMP
- PHP version: [insert your PHP version]
- WP User Frontend (WPUF): [insert your plugin version]
Problem
When I use an existing WPUF form, it works correctly. However, after adding new fields to a form, I encounter this PHP warning:
Warning: Undefined array key "submit_text" in wp-content/plugins/wp-user-frontend/includes/Frontend_Render_Form.php on line 76The stack trace points to
Frontend_Render_Form->submit_button(), called while rendering a form using the[wpuf_form id="109"]shortcode.Database investigation
I checked the
wpuf_form_settingspost metadata for two forms:- Form ID 109 (
SubmitPost):a:0:{}— an empty settings array. - Form ID 145 (
Sample Form): a populated settings array containingsubmit_textandupdate_text, among other settings.
The existing Sample Form works correctly. The problem returns after adding new fields.
I have already entered the submit-button text in the form settings, so the warning does not appear to be caused simply by leaving that field blank.
Expected behaviour
Adding new fields should not cause the form’s settings to become empty or result in undefined array key warnings when the form is rendered.
Request
Could the development team investigate whether adding fields causes WPUF to lose or fail to save the form settings? The renderer should also handle missing settings safely, but I would appreciate clarification of why the settings array becomes empty in the first place.
I can provide the full stack trace and relevant database query results if needed.
( ! ) Warning: Undefined array key “submit_text” in C:\VirtualHosts\ClientsManagement\wp-content\plugins\wp-user-frontend\includes\Frontend_Render_Form.php on line 76 Call Stack #TimeMemoryFunctionLocation 10.0009376600{main}( )…\index.php:0 20.0015377928require( ‘C:\VirtualHosts\ClientsManagement\wp-blog-header.php )…\index.php:17 35.767997301200require_once( ‘C:\VirtualHosts\ClientsManagement\wp-includes\template-loader.php )…\wp-blog-header.php:19 46.071898358776include( ‘C:\VirtualHosts\ClientsManagement\wp-content\themes\louis\page.php )…\template-loader.php:132 58.2323110097208get_template_part( $slug = ‘inc/partials/content’, $name = ‘page’, $args = ??? )…\page.php:16 68.2343110098128locate_template( $template_names = [0 => ‘inc/partials/content-page.php’, 1 => ‘inc/partials/content.php’], $load = TRUE, $load_once = FALSE, $args = [] )…\general-template.php:206 78.2346110098256load_template( $_template_file = ‘C:\\VirtualHosts\\ClientsManagement/wp-content/themes/Louis/inc/partials/content-page.php’, $load_once = FALSE, $args = [] )…\template.php:815 88.2352110100712require( ‘C:\VirtualHosts\ClientsManagement\wp-content\themes\louis\inc\partials\content-page.php )…\template.php:882 98.2447110216048the_content( $more_link_text = ???, $strip_teaser = ??? )…\content-page.php:16 108.2460110216080apply_filters( $hook_name = ‘the_content’, $value = ” )…\post-template.php:256 118.2461110216544WP_Hook->apply_filters( $value = ”, $args = [0 => ”] )…\plugin.php:206 128.2548110194776WeDevs\Wpuf\Frontend\Form_Preview->the_content( $content = ” )…\class-wp-hook.php:353 138.2553110195096do_shortcode( $content = ‘
Your selected form is no longer available.’, $ignore_html = ??? )…\Form_Preview.php:98 148.2555110199032preg_replace_callback( $pattern = ‘/\\[(\\[?)(wpuf_form)(?![\\w-])([^\\]\\/]*(?:\\/(?!\\])[^\\]\\/]*)*?)(?:(\\/)\\]|\\](?:([^\\[]*+(?:\\[(?!\\/\\2\\])[^\\[]*+)*+)\\[\\/\\2\\])?)(\\]?)/’, $callback = ‘do_shortcode_tag’, $subject = ‘
Your selected form is no longer available.’ )…\shortcodes.php:273 158.2557110199504do_shortcode_tag( $m = [0 => ‘
Your selected form is no longer available.’, 1 => ”, 2 => ‘wpuf_form’, 3 => ‘ id=”145″‘, 4 => ”, 5 => ”, 6 => ”] )…\shortcodes.php:273 168.2560110200416WeDevs\Wpuf\Frontend\Frontend_Form->add_post_shortcode( $atts = [‘id’ => ‘145’], ”, ‘wpuf_form’ )…\shortcodes.php:434 178.2760110343592WeDevs\Wpuf\Frontend_Render_Form->render_form( $form_id = ‘145’, $post_id = NULL, $atts = [‘id’ => ‘145’], $form = class WeDevs\Wpuf\Admin\Forms\Form { public $id = ‘145’; public $form_fields = []; public $data = class WP_Post { public $ID = 145; public $post_author = ‘1’; public $post_date = ‘2019-05-20 17:18:25’; public $post_date_gmt = ‘2019-05-20 17:18:25’; public $post_content = ”; public $post_title = ‘SampleForm’; public $post_excerpt = ”; public $post_status = ‘publish’; public $comment_status = ‘closed’; public $ping_status = ‘closed’; public $post_password = ”; public $post_name = ‘sample-form-2’; public $to_ping = ”; public $pinged = ”; public $post_modified = ‘2026-10-22 21:52:19’; public $post_modified_gmt = ‘2026-10-22 21:52:19’; public $post_content_filtered = ”; public $post_parent = 0; public $guid = ‘http://clientsmanagement/wpuf_forms/sample-form-2/’; public $menu_order = 0; public $post_type = ‘wpuf_forms’; public $post_mime_type = ”; public $comment_count = ‘0’; public $filter = ‘raw’ } } )…\Frontend_Form.php:396 188.3995111509336WeDevs\Wpuf\Frontend_Render_Form->submit_button( $form_id = ‘145’, $form_settings = [], $post_id = NULL )…\Frontend_Render_Form.php:361 ” />
You must be logged in to reply to this review.