Skip to content

Commit

Permalink
Updates to 2.8.13
Browse files Browse the repository at this point in the history
  • Loading branch information
Gravity Forms committed Jun 27, 2024
1 parent 2350057 commit 3ca2bee
Show file tree
Hide file tree
Showing 9 changed files with 182 additions and 184 deletions.
7 changes: 7 additions & 0 deletions change_log.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
### 2.8.13 | 2024-06-26
- Fixed an issue where custom theme styles are sometimes not applied on confirmation page or when navigating between pages in a multi-page form.
- Fixed an issue where the AJAX spinner init script is output in save and continue notifications, which can impact deliverability in some environments.
- Fixed an issue where a choice of 00 in the minute settings for the form scheduled start and end times changes to 01 on save.
- Updated and improved the performance of database queries by removing the legacy table check.
- AF: Fixed an issue where a saved value of 0 is not displayed in text type settings.

### 2.8.12 | 2024-05-29
- Fixed an issue where a console error is thrown if gform.initializeOnLoaded is called directly.
- Fixed an issue where the Conversational Forms Add-On settings page is not displayed if the site is using a plugin to manage roles and capabilities.
Expand Down
24 changes: 12 additions & 12 deletions form_display.php
Original file line number Diff line number Diff line change
Expand Up @@ -4810,23 +4810,23 @@ public static function replace_save_variables( $text, $form, $resume_token, $ema
</div>";
}

if ( ! $ajax ) {
/**
* Allows users to disable the spinner on non-ajax forms.
*
* @since 2.7
*
* @param bool $show Whether to show the spinner on non-ajax-forms.
*
* @return bool
*/
$always_show_spinner = gf_apply_filters( array( 'gform_always_show_spinner', $form_id ), true );
/**
* Allows users to disable the spinner on non-ajax forms.
*
* @since 2.7
*
* @param bool $show Whether to show the spinner on non-ajax-forms.
*
* @return bool
*/
$always_show_spinner = gf_apply_filters( array( 'gform_always_show_spinner', $form_id ), true );
if ( ! $ajax && $always_show_spinner ) {
$default_spinner = GFCommon::get_base_url() . '/images/spinner.svg';
$spinner_url = gf_apply_filters( array( 'gform_ajax_spinner_url', $form_id ), $default_spinner, $form );
$theme_slug = self::get_form_theme_slug( $form );
$is_legacy = $default_spinner !== $spinner_url || in_array( $theme_slug, array( 'gravity-theme', 'legacy' ) );

$text .= '<script>gform.initializeOnLoaded( function() {' .
$resume_form .= '<script>gform.initializeOnLoaded( function() {' .
"gformInitSpinner( {$form_id}, '{$spinner_url}', " . ( $is_legacy ? 'true' : 'false' ) . " );" .
" });</script>";
}
Expand Down
9 changes: 2 additions & 7 deletions forms_model.php
Original file line number Diff line number Diff line change
Expand Up @@ -5788,14 +5788,12 @@ public static function get_tables() {

public static function drop_tables() {
global $wpdb;
remove_filter( 'query', array( 'GFForms', 'filter_query' ) );
foreach ( GF_Forms_Model_Legacy::get_legacy_tables() as $table ) {
$wpdb->query( "DROP TABLE IF EXISTS $table" );
}
foreach ( self::get_tables() as $table ) {
$wpdb->query( "DROP TABLE IF EXISTS $table" );
}
add_filter( 'query', array( 'GFForms', 'filter_query' ) );
}

/**
Expand Down Expand Up @@ -5825,9 +5823,6 @@ public static function mu_drop_tables( $drop_tables ) {

$drop_tables = array_merge( $drop_tables, $legacy_tables );

// Prevent the legacy table query notice when they are dropped by wp_uninitialize_site().
remove_filter( 'query', array( 'GFForms', 'filter_query' ) );

return $drop_tables;
}

Expand Down Expand Up @@ -7823,11 +7818,11 @@ public static function sanitize_settings( $form ) {
$form['scheduleForm'] = (bool) $form['scheduleForm'];
$form['scheduleStart'] = $form['scheduleForm'] ? wp_strip_all_tags( $form['scheduleStart'] ) : '';
$form['scheduleStartHour'] = $form['scheduleForm'] ? GFCommon::int_range( $form['scheduleStartHour'], 1, 12 ) : '';
$form['scheduleStartMinute'] = $form['scheduleForm'] ? GFCommon::int_range( $form['scheduleStartMinute'], 1, 60 ) : '';
$form['scheduleStartMinute'] = $form['scheduleForm'] ? GFCommon::int_range( $form['scheduleStartMinute'], 0, 59 ) : '';
$form['scheduleStartAmpm'] = $form['scheduleForm'] ? GFCommon::whitelist( $form['scheduleStartAmpm'], array( 'am', 'pm' ) ) : '';
$form['scheduleEnd'] = $form['scheduleForm'] ? wp_strip_all_tags( $form['scheduleEnd'] ) : '';
$form['scheduleEndHour'] = $form['scheduleForm'] ? GFCommon::int_range( $form['scheduleEndHour'], 1, 12 ) : '';
$form['scheduleEndMinute'] = $form['scheduleForm'] ? GFCommon::int_range( $form['scheduleEndMinute'], 1, 60 ) : '';
$form['scheduleEndMinute'] = $form['scheduleForm'] ? GFCommon::int_range( $form['scheduleEndMinute'], 0, 59 ) : '';
$form['scheduleEndAmpm'] = $form['scheduleForm'] ? GFCommon::whitelist( $form['scheduleEndAmpm'], array( 'am', 'pm' ) ) : '';
$form['schedulePendingMessage'] = $form['scheduleForm'] ? self::maybe_wp_kses( $form['schedulePendingMessage'] ) : '';
$form['scheduleMessage'] = $form['scheduleForm'] ? self::maybe_wp_kses( $form['scheduleMessage'] ) : '';
Expand Down
9 changes: 5 additions & 4 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.8.12
Version: 2.8.13
Requires at least: 4.0
Requires PHP: 5.6
Author: Gravity Forms
Expand Down Expand Up @@ -204,7 +204,6 @@
add_filter( 'upgrader_pre_install', array( 'GFForms', 'validate_upgrade' ), 10, 2 );
add_filter( 'tiny_mce_before_init', array( 'GFForms', 'modify_tiny_mce_4' ), 20 );
add_filter( 'user_has_cap', array( 'RGForms', 'user_has_cap' ), 10, 4 );
add_filter( 'query', array( 'GFForms', 'filter_query' ) );
add_filter( 'plugin_auto_update_setting_html', array( 'GFForms', 'auto_update_message' ), 9, 3 );
add_filter( 'plugin_auto_update_debug_string', array( 'GFForms', 'auto_update_debug_message' ), 10, 4 );

Expand Down Expand Up @@ -245,7 +244,7 @@ class GFForms {
*
* @var string $version The version number.
*/
public static $version = '2.8.12';
public static $version = '2.8.13';

/**
* Handles background upgrade tasks.
Expand Down Expand Up @@ -2125,7 +2124,7 @@ public static function get_ajax_form_response() {
$display_title = ! isset( $args['title'] ) || ! empty( $args['title'] ) ? true : false;
$display_description = ! isset( $args['description'] ) || ! empty( $args['description'] ) ? true : false;
$tabindex = isset( $args['tabindex'] ) ? absint( $args['tabindex'] ) : 0;
$theme = isset( $args['theme'] ) ? GFCommon::strip_all_tags_from_json_string( $args['theme'] ) : null;
$theme = isset( $args['theme'] ) ? sanitize_text_field( $args['theme'] ) : null;
$styles = isset( $args['styles'] ) ? GFCommon::strip_all_tags_from_json_string( $args['styles'] ) : null;

parse_str( rgpost( 'gform_field_values' ), $field_values );
Expand Down Expand Up @@ -6596,12 +6595,14 @@ public static function init_background_upgrader() {
* access tables that are not valid for this version of Gravity Forms.
*
* @since 2.3
* @deprecated 2.8.13
*
* @param $query
*
* @return string
*/
public static function filter_query( $query ) {
_deprecated_function( __METHOD__, '2.8.13' );
global $wpdb;

if ( preg_match( "/$wpdb->prefix(rg_lead_detail|rg_lead_meta|rg_lead_notes|rg_lead|rg_form_meta|rg_form_view|rg_form|rg_incomplete_submissions)/", $query, $matches ) ) {
Expand Down
2 changes: 0 additions & 2 deletions includes/addon/class-gf-addon.php
Original file line number Diff line number Diff line change
Expand Up @@ -5456,7 +5456,6 @@ public function uninstall_addon() {

// remove entry meta
$meta_table = version_compare( GFFormsModel::get_database_version(), '2.3-dev-1', '<' ) ? GFFormsModel::get_lead_meta_table_name() : GFFormsModel::get_entry_meta_table_name();
remove_filter( 'query', array( 'GFForms', 'filter_query' ) );
foreach ( $forms as $form ) {
$all_form_ids[] = $form->id;
$entry_meta = $this->get_entry_meta( array(), $form->id );
Expand All @@ -5467,7 +5466,6 @@ public function uninstall_addon() {
}
}
}
add_filter( 'query', array( 'GFForms', 'filter_query' ) );

//remove form settings
if ( ! empty( $all_form_ids ) ) {
Expand Down
1 change: 0 additions & 1 deletion includes/class-gf-background-upgrader.php
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,6 @@ protected function task( $callback ) {
}

if ( is_callable( $callback ) ) {
remove_filter( 'query', array( 'GFForms', 'filter_query' ) );
GFCommon::log_debug( sprintf( '%s(): Running callback: %s', __METHOD__, print_r( $callback, 1 ) ) );
$needs_more_time = call_user_func( $callback );
if ( $needs_more_time ) {
Expand Down
2 changes: 0 additions & 2 deletions includes/class-gf-upgrade.php
Original file line number Diff line number Diff line change
Expand Up @@ -1379,8 +1379,6 @@ public function get_wp_option( $option_name ) {
* Upgrade routine from gravity forms version 2.0.4.7 and below
*/
protected function post_upgrade_schema_2047() {
remove_filter( 'query', array( 'GFForms', 'filter_query' ) );

global $wpdb;

$versions = $this->get_versions();
Expand Down
2 changes: 1 addition & 1 deletion includes/settings/fields/class-text.php
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ public function markup() {
esc_attr( $this->input_type ),
esc_attr( $this->settings->get_input_name_prefix() ),
esc_attr( $this->name ),
$value ? esc_attr( htmlspecialchars( $value, ENT_QUOTES ) ) : '',
! rgblank( $value ) ? esc_attr( htmlspecialchars( $value, ENT_QUOTES ) ) : '',
$this->get_describer() ? sprintf( 'aria-describedby="%s"', $this->get_describer() ) : '',
implode( ' ', $this->get_attributes() ),
isset( $this->append ) ? sprintf( '<span class="gform-settings-field__text-append">%s</span>', esc_html( $this->append ) ) : '',
Expand Down
Loading

0 comments on commit 3ca2bee

Please sign in to comment.