| Server IP : 23.94.149.180 / Your IP : 216.73.216.147 Web Server : nginx/1.20.1 System : Linux deadrock 5.14.0-741.22.1.el9_9.x86_64 #1 SMP PREEMPT_DYNAMIC Thu Nov 12 15:18:14 UTC 2026 x86_64 User : nginx ( 991) PHP Version : 8.6.0 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : OFF | Sudo : ON | Pkexec : OFF Directory : /files/www/curiousmindgarden/mind/wp-content/plugins/email-subscribers/ |
Upload File : |
# Form Rendering Test Results
## Frontend Changes Made
1. **FormWizardNew.tsx**:
- Removed `firstName`, `lastName`, `birthday`, `company` from default field configuration
- Added single `name` field with `id: 'name'`, `type: 'text'`
- Updated form fields state to use `name` instead of separate first/last names
2. **Backend Processing**:
- `ES_Shortcode::render_new_form_field()` handles `case 'text'` for name field
- `ES_Shortcode::get_text_field_html()` creates `esfpx_name` input field
- `ES_Handle_Subscription::process_request()` processes `esfpx_name` correctly
- `ES_Common::prepare_first_name_last_name()` splits name into first/last automatically
## Expected Behavior
When a form is created with the new field configuration:
```javascript
{
id: 'name',
name: 'Name',
enabled: true,
type: 'text',
label: 'Name',
placeholder: 'Enter your name',
required: false
}
```
The frontend should render:
```html
<input type="text" name="esfpx_name" class="ig_es_form_field_text" placeholder="Enter your name" />
```
And the backend should process `$_POST['esfpx_name']` correctly.
## Testing Required
1. Create a new form using the updated React UI
2. Verify the `name` field appears in the sidebar
3. Enable the `name` field and configure it
4. Save the form and check the database `body` field contains correct structure
5. Render the form using shortcode `[email-subscribers-form id="X"]`
6. Verify the HTML output includes `esfpx_name` input field
7. Submit the form and verify subscription works
8. Check that first_name and last_name are properly extracted from the name field
## Status: ✅ READY FOR TESTING
The changes should work correctly because:
- React UI now sends `{ id: 'name', type: 'text', ... }` in form body
- PHP `render_new_form_field()` handles `case 'text'` and calls `get_text_field_html()`
- Field name becomes `esfpx_name` which matches what backend expects
- Form submission processing already handles `esfpx_name` correctly