Skip to content

Commit

Permalink
Updates to 2.7.6
Browse files Browse the repository at this point in the history
  • Loading branch information
Gravity Forms committed May 11, 2023
1 parent 6dd5e11 commit cb5dab1
Show file tree
Hide file tree
Showing 11 changed files with 77 additions and 51 deletions.
2 changes: 1 addition & 1 deletion assets/css/dist/gravity-forms-theme-framework.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion assets/css/dist/gravity-forms-theme-framework.min.css

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion assets/css/dist/gravity-forms-theme-reset.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion assets/css/dist/gravity-forms-theme-reset.min.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions change_log.txt
Original file line number Diff line number Diff line change
@@ -1,10 +1,16 @@
### 2.7.6 | 2023-05-10
- Fixed an issue where the HTML field filters out JavaScript.
- Updated the handling of submit button conditional logic to add a data attribute indicating whether a button is hidden or not.
- API: Added `gform/conditionalLogic/applyRules/start` and `gform/conditionalLogic/applyRules/end` JS event triggers for conditional logic to accommodate conversational forms.

### 2.7.5 | 2023-05-03
- Added security enhancements.
- Fixed an issue where `GF_Field_Consent::is_value_submission_empty()` returns the wrong result when editable fields are validated during progress save on the Gravity Flow User Input step.
- Fixed an issue where Conversational Forms with similar slug names to a post or page are not rendered.
- Fixed an issue where turning off Legacy Markup with the `gform_enable_legacy_markup` filter results in a fatal error.
- Updated the minimum WordPress version on the System Status page to 6.1.
- Updated the location of our NPM packages.
- Updated the theme framework reset to inherit site theme typographic styles for form confirmation html.
- API: Added a new function `GFFormsModel::get_forms_columns()`` to get a list of specified form data. Credit: The GravityKit team.
- API: Added "date_updated" to the list of form database columns. Credit: The GravityKit team.
- API: Added the `gform_conditional_logic_is_valid_flyout_click` filter to allow third parties to designate valid conditional logic flyout clicks. Credit: GravityWiz.
Expand Down
15 changes: 12 additions & 3 deletions form_display.php
Original file line number Diff line number Diff line change
Expand Up @@ -1368,6 +1368,7 @@ public static function get_form( $form_id, $display_title = true, $display_descr
"if(window['gformRedirect']) {gformRedirect();}" .
'}' .
"jQuery(document).trigger('gform_post_render', [{$form_id}, current_page]);" .
"gform.utils.trigger({ event: 'gform/postRender', native: false, data: { formId: {$form_id}, currentPage: current_page } });" .
'} );' .
'} );';

Expand Down Expand Up @@ -1410,7 +1411,10 @@ public static function get_form( $form_id, $display_title = true, $display_descr
add_action( 'gform_preview_footer', $callback );
} else {
$form_string .= self::get_form_init_scripts( $form );
$init_script_body = "gform.initializeOnLoaded( function() { jQuery(document).trigger('gform_post_render', [{$form_id}, {$current_page}]) } );";
$init_script_body = 'gform.initializeOnLoaded( function() {' .
"jQuery(document).trigger('gform_post_render', [{$form_id}, {$current_page}]);" .
"gform.utils.trigger({ event: 'gform/postRender', native: false, data: { formId: {$form_id}, currentPage: {$current_page} } });" .
'} );';
$form_string .= GFCommon::get_inline_script_tag( $init_script_body );
}
}
Expand Down Expand Up @@ -1482,7 +1486,10 @@ public static function footer_init_scripts( $form_id ) {
$form = RGFormsModel::get_form_meta( $form_id );
$form_string = self::get_form_init_scripts( $form );
$current_page = self::get_current_page( $form_id );
$footer_script_body = "gform.initializeOnLoaded( function() { jQuery(document).trigger('gform_post_render', [{$form_id}, {$current_page}]) } );";
$footer_script_body = 'gform.initializeOnLoaded( function() {' .
"jQuery(document).trigger('gform_post_render', [{$form_id}, {$current_page}]);" .
"gform.utils.trigger({ event: 'gform/postRender', native: false, data: { formId: {$form_id}, currentPage: {$current_page} } });" .
'} );';
$form_string .= GFCommon::get_inline_script_tag( $footer_script_body );

/**
Expand Down Expand Up @@ -3250,10 +3257,12 @@ private static function get_conditional_logic( $form, $field_values = array() )
"window['gf_number_format'] = '" . $number_format . "';" .

'jQuery(document).ready(function(){' .
"gform.utils.trigger({ event: 'gform/conditionalLogic/init/start', native: false, data: { formId: {$form['id']}, fields: null, isInit: true } });" .
"window['gformInitPriceFields']();" .
"gf_apply_rules({$form['id']}, " . json_encode( $fields_with_logic ) . ', true);' .
"jQuery('#gform_wrapper_{$form['id']}').show();" .
"jQuery(document).trigger('gform_post_conditional_logic', [{$form['id']}, null, true]);" .
"gform.utils.trigger({ event: 'gform/conditionalLogic/init/end', native: false, data: { formId: {$form['id']}, fields: null, isInit: true } });" .

'} );' .

Expand Down Expand Up @@ -4583,7 +4592,7 @@ public static function handle_save_email_confirmation( $form, $ajax ) {

$confirmation_message = rgar( $form['confirmation'], 'message' );

$confirmation = "<div id='gform_confirmation_wrapper_{$form['id']}' class='form_saved_message_sent gform_confirmation_wrapper {$css_class} gform_wrapper' role='alert' {$form_theme}><span>{$confirmation_message}</span></div>";
$confirmation = "<div id='gform_confirmation_wrapper_{$form['id']}' class='form_saved_message_sent gform_confirmation_wrapper {$css_class} gform_wrapper' role='alert' {$form_theme}>{$confirmation_message}</div>";
$nl2br = rgar( $form['confirmation'], 'disableAutoformat' ) ? false : true;
$save_email_confirmation = self::replace_save_variables( $confirmation, $form, $resume_token, $resume_email );
$save_email_confirmation = GFCommon::replace_variables( $save_email_confirmation, $form, $entry, false, true, $nl2br );
Expand Down
4 changes: 2 additions & 2 deletions gravityforms.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
Plugin Name: Gravity Forms
Plugin URI: https://gravityforms.com
Description: Easily create web forms and manage form entries within the WordPress admin.
Version: 2.7.5
Version: 2.7.6
Requires at least: 4.0
Requires PHP: 5.6
Author: Gravity Forms
Expand Down Expand Up @@ -245,7 +245,7 @@ class GFForms {
*
* @var string $version The version number.
*/
public static $version = '2.7.5';
public static $version = '2.7.6';

/**
* Handles background upgrade tasks.
Expand Down
2 changes: 1 addition & 1 deletion includes/fields/class-gf-field-html.php
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ public function get_field_content( $value, $force_frontend_label, $form ) {

public function sanitize_settings() {
parent::sanitize_settings();
$this->content = wp_kses( $this->content, 'post' );
$this->content = GFCommon::maybe_wp_kses( $this->content );
}

public function do_shortcode( $content ){
Expand Down
11 changes: 11 additions & 0 deletions js/conditional_logic.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,21 @@ gform.addAction( 'gform_input_change', function( elem, formId, fieldId ) {
function gf_apply_rules(formId, fields, isInit){

jQuery(document).trigger( 'gform_pre_conditional_logic', [ formId, fields, isInit ] );
gform.utils.trigger( {
event: 'gform/conditionalLogic/applyRules/start',
native: false,
data: { formId: formId, fields: fields, isInit: isInit },
} );
for(var i=0; i < fields.length; i++){
gf_apply_field_rule(formId, fields[i], isInit, function(){
var is_last_field = ( i >= fields.length - 1 );
if( is_last_field ) {
jQuery(document).trigger('gform_post_conditional_logic', [formId, fields, isInit]);
gform.utils.trigger( {
event: 'gform/conditionalLogic/applyRules/end',
native: false,
data: { formId: formId, fields: fields, isInit: isInit },
} );
if(window["gformCalculateTotalPrice"]){
window["gformCalculateTotalPrice"](formId);
}
Expand Down Expand Up @@ -514,6 +524,7 @@ function gf_do_action(action, targetId, useAnimation, defaultValues, isInit, cal
// Handle conditional submit and next buttons.
if ( $target.is( 'input[type="submit"]' ) || $target.hasClass( 'gform_next_button' ) ) {
$target.attr( 'disabled', 'disabled' ).hide();
$target.attr( 'data-conditional-logic', 'hidden' );
if ( '1' === gf_legacy.is_legacy ) {
// for legacy markup, let screen readers read the button.
$target.addClass( 'screen-reader-text' );
Expand Down
Loading

0 comments on commit cb5dab1

Please sign in to comment.