• Title: WPUF form settings become empty after adding new fields — Undefined array key submit_text

    Environment

    • 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 76

    The 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_settings post metadata for two forms:

    • Form ID 109 (SubmitPost): a:0:{} — an empty settings array.
    • Form ID 145 (Sample Form): a populated settings array containing submit_text and update_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 ” />

Viewing 1 replies (of 1 total)
  • Plugin Support Md. Anower Hossain

    (@anowerhossain16)

    Hi @taofeekfolami,

    Thanks for the detailed report and the database check. Here is what we found and what you can do now.

    What we found

    • Adding a Text field to a form and saving did not wipe the form’s settings in our tests. They stayed intact, and the submit button text was unchanged.
    • We did reproduce your warning another way. A form whose settings are stored empty (a:0:{}, like your form 109) triggers Undefined array key "submit_text" at Frontend_Render_Form.php line 76, and the submit button renders with no label.

    So the warning is real, but we couldn’t reproduce the cause of the empty settings. We don’t yet know why your form’s settings ended up empty.

    One thing in your trace to check

    Your stack trace shows form 145 rendering with empty settings ($form_settings = []), even though your database check showed 145 as populated. Form 145’s modified time (21:52) is also after you posted. Please re-check wpuf_form_settings for both 109 and 145 right now, since 145 may have been emptied after your first check.

    How to fix form 109

    1. Open form 109 in the form builder and click Save once. This restores the form’s settings and stops the warning.
    2. Go to the form’s Settings, enter your submit button text and update button text, and save again. Step 1 brings the settings back but leaves those two labels blank, so without this step the button has no label.

    Please don’t duplicate form 145 as a workaround until you’ve confirmed its settings are intact, since a duplicate would copy whatever state it’s in now.

    What we need from you to track down the root cause

    • WPUF version, and whether WPUF Pro is active
    • PHP version (your post still has the [insert your PHP version] placeholder)
    • How form 109 was created: form builder, import, duplicate, or an older plugin version
    • The exact steps you took right before the settings went empty, such as which fields you added and whether you saved in between
    • Whether other plugins are active that touch forms or post meta

    On the warning itself

    The form renderer shouldn’t throw a warning when settings are missing, so we’ll make that code safer regardless of what turns up about the empty settings.

    We are looking forward to hearing from you.
    Have a nice day.

Viewing 1 replies (of 1 total)

You must be logged in to reply to this review.