Skip to content

Commit 76ff293

Browse files
kraftbjmatticbot
authored andcommitted
Forms: Fix checkbox field value not output in classic editor (#46354)
* Update class-editor-view.php * Create replace-escape-function-in-checkbox-input-value * Add unit test for checkbox template value output Verifies that the checkbox template outputs a non-empty value attribute, catching the bug where esc_attr__() was used instead of esc_attr_e(). * chore: add Jetpack plugin changelog for checkbox fix --------- Co-authored-by: Brandon Kraft <[email protected]> Committed via a GitHub action: https://github.com/Automattic/jetpack/actions/runs/20973734962 Upstream-Ref: Automattic/jetpack@35f8571
1 parent 81750d3 commit 76ff293

File tree

7 files changed

+138
-136
lines changed

7 files changed

+138
-136
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ This is an alpha version! The changes listed here are not final.
1111
- Instant Search: Show WooCommerce product filters in filter widget
1212

1313
### Bug fixes
14+
- Contact Form: Fixed checkbox field value not being properly output in the classic editor form builder.
1415
- Shortcode: Fix broken YouTube URL on the classic editor
1516
- Slideshow: Ensure slideshows do not stretch to parent container width on mobile if no list height is set.
1617

jetpack_vendor/automattic/jetpack-forms/CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ This is an alpha version! The changes listed here are not final.
1616
### Changed
1717
- Forms: update dataviews actions to match between old and new dashboard.
1818
- Forms: update form submission confirmation page with new design.
19+
- Replace escape function in checkbox input value.
1920
- Update package dependencies.
2021
- Update read/unread status column style to match old dashboard.
2122
- Use Gravatar component in new dashboard inbox.

jetpack_vendor/automattic/jetpack-forms/src/contact-form/class-editor-view.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -179,7 +179,7 @@ public static function editor_view_js_templates() {
179179
<script type="text/html" id="tmpl-grunion-field-checkbox">
180180
<div>
181181
<label class='grunion-field-label checkbox'>
182-
<input type='checkbox' name='{{ data.id }}' value='<?php esc_attr__( 'Yes', 'jetpack-forms' ); ?>' class="{{ data.class }}" <# if ( data.value ) print( 'checked="checked"' ) #> />
182+
<input type='checkbox' name='{{ data.id }}' value='<?php esc_attr_e( 'Yes', 'jetpack-forms' ); ?>' class="{{ data.class }}" <# if ( data.value ) print( 'checked="checked"' ) #> />
183183
<span>{{ data.label }}</span><# if ( data.required ) print( " <span>" + data.required + "</span>" ) #>
184184
</label>
185185
<div class='clear-form'></div>

jetpack_vendor/i18n-map.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@
6666
),
6767
'jetpack-forms' => array(
6868
'path' => 'jetpack_vendor/automattic/jetpack-forms',
69-
'ver' => '7.4.0-alpha1768326783',
69+
'ver' => '7.4.0-alpha1768340822',
7070
),
7171
'jetpack-image-cdn' => array(
7272
'path' => 'jetpack_vendor/automattic/jetpack-image-cdn',

0 commit comments

Comments
 (0)