Skip to content

Commit

Permalink
Merge branch 'release/2.1.2'
Browse files Browse the repository at this point in the history
  • Loading branch information
remcotolsma committed Jan 17, 2017
2 parents 39afb20 + f6fe07f commit 949c4f7
Show file tree
Hide file tree
Showing 53 changed files with 1,157 additions and 725 deletions.
50 changes: 50 additions & 0 deletions change_log.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,53 @@
------------------------------------------------------------------------------------------------------------------
Version 2.1.2
- Added $entry as a fourth parameter for the gform_merge_tag_data filter.
- Added support for auxiliary data for confirmations.
- Added GFFormDisplay::get_confirmation_message() method; refactored from GFFormDisplay::handle_confirmation().
- Added logging statements.
- Added the $field parameter to the gform_other_choice_value filter.
- Added gform_subscription_cancelled action.
- Added the gform_secure_file_download_url filter for overriding the url returned when the file upload field value is output in the entries area and merge tags. Credit: Chris Wiegman.
- Added the gform_purge_expired_incomplete_submissions_query filter allowing the query used to purge expired incomplete (save and continue) submissions to be overridden.
- Added gform_include_bom_export_entries filter allowing the BOM character to be excluded from entry export files.
- Added the gform_secure_file_download_is_https filter which can be used to prevent file upload urls from being changed from http to https when SSL is enabled. Credit: Chris Wiegman.
- Added the gform_fileupload_entry_value_file_path filter allowing the file upload url to be overridden when the field values are being prepared for output for the entry detail page and {all_fields} merge tag. Credit: Chris Wiegman.
- Added "numeric" modifier to merge tags to return numeric/unformatted numbers.
- Updated English translations (NZ, ZA). Credit: Ross McKay.
- Updated font size definitions to em (relative font size) in favor of rem (root font size)
- Updated the product field types array used by GFCommon::is_product_field() to include the hiddenproduct, singleproduct, and singleshipping input types. Credit: Naomi C. Bush.
- Updated the minimum version of WordPress required for support to 4.6.
- Updated the Afrikaans translation filename.
- Fixed issue with conditional logic when using numbers formatted with comma as decimal separators.
- Fixed conflict when reCaptcha script is enqueued by other plugins and themes.
- Fixed an issue where the partial entry was not available to the gform_review_page filter when resuming an incomplete submission.
- Fixed fatal error on PHP 7.1
- Fixed PHP warning on the entry list page if the value retrieved from the gform_entries_screen_options user option is not an array.
- Fixed a fatal error which would occur with 2.1.1.14+ if the cached version info contained a WP_Error.
- Fixed file size limit validation message not appearing when a validation message already exists.
- Fixed an issue with option currency formatting with decimal comma separator.
- Fixed an issue with total field formatting on currencies with decimal comma separator.
- Fixed an issue with the processing of custom fields during post creation which prevented the content template being processed.
- Fixed an issue with number formatting on calculated fields.
- Fixed an issue on number range setting defaulting to 'false'.
- Fixed an issue with form import process where the edit form link in incorrect.
- Fixed an issue with currency formatting.
- Fixed an issue where the version info may not get cached on some systems resulting in very slow loading of the admin pages.
- Fixed an issue with the Notifications meta box on the entry detail page when the user doesn't have the gravityforms_edit_entry_notes capability.
- Fixed an issue with the forms sent to the gform_forms_post_import action after import.
- Fixed an issue where GFFormDisplay::has_price_field() could incorrectly return false for some form configurations.
- Fixed issue where gfAjaxSpinner() did not link to a valid default spinner graphic.
- Fixed a JS error in the form editor when deleting a field on a form added via the GFAPI where the form button properties have not been defined.
- Fixed an issue with the submission time evaluation of conditional logic based on the multiselect type field.
- Fixed rgget helper function returning null when the value is 0.
- Fixed the send email form on the save and continue confirmation which occasionally would not submit when AJAX is enabled.
- Fixed entry filter from disappearing when no search results are found.
- Fixed entry filter not correctly populating search drop down when starred is set to no.
- Fixed a fatal error when a WP_Error object is passed as the second parameter of the rgget helper function.
- Fixed a fatal error which could occur on the entry detail page if a WP_Error is returned when getting the entry to be displayed.
- AF: Fixed an issue where following successful PayPal payment only one of the add-ons delayed feeds would be processed and would not be added to the entry processed_feeds meta item.
- AF: Updated logging for feed processing.
- API: Fixed an issue with entry searches when using numeric values for checkbox search keys which could return incorrect results.

------------------------------------------------------------------------------------------------------------------
Version 2.1.1
- Added PF (French Polynesia) to the country code list. Credit: the GravityView team.
Expand Down
97 changes: 75 additions & 22 deletions common.php
Original file line number Diff line number Diff line change
Expand Up @@ -875,13 +875,16 @@ public static function replace_variables( $text, $form, $lead, $url_encode = fal
/**
* Filter data that will be used to replace merge tags.
*
* @since 2.1.1.11 Added the Entry Object as the 4th parameter.
*
* @param $data array Array of key/value pairs, where key is used as merge tag and value is an array of data available to the merge tag.
* @param $text string String of text which will be searched for merge tags.
* @param $form array Current form object.
* @param $lead array The current Entry Object.
*
* @see https://www.gravityhelp.com/documentation/article/gform_merge_tag_data/
*/
$data = apply_filters( 'gform_merge_tag_data', $data, $text, $form );
$data = apply_filters( 'gform_merge_tag_data', $data, $text, $form, $lead );

$lead = $data['entry'];

Expand Down Expand Up @@ -2006,8 +2009,26 @@ public static function is_pricing_field( $field_type ) {
return self::is_product_field( $field_type ) || $field_type == 'donation';
}

/**
* Checks if a field is a product field.
*
* @access public
* @since 2.1.1.12 Added support for hiddenproduct, singleproduct, and singleshipping input types.
*
* @param string $field_type The field type.
*
* @return bool Returns true if it is a product field. Otherwise, false.
*/
public static function is_product_field( $field_type ) {
$product_fields = apply_filters( 'gform_product_field_types', array( 'option', 'quantity', 'product', 'total', 'shipping', 'calculation', 'price' ) );
/**
* Filters the input types to use when checking if a field is a product field.
*
* @since 2.1.1.12 Added support for hiddenproduct, singleproduct, and singleshipping input types.
* @since 1.9.14
*
* @param $product_fields The product field types.
*/
$product_fields = apply_filters( 'gform_product_field_types', array( 'option', 'quantity', 'product', 'total', 'shipping', 'calculation', 'price', 'hiddenproduct', 'singleproduct', 'singleshipping' ) );
return in_array( $field_type, $product_fields );
}

Expand Down Expand Up @@ -2092,18 +2113,23 @@ public static function get_key_info( $key ) {

public static function get_version_info( $cache = true ) {

$raw_response = get_transient( 'gform_update_info' );
$version_info = get_transient( 'gform_update_info' );
if ( ! $cache ) {
$raw_response = null;
$version_info = null;
}

if ( is_wp_error( $version_info ) || isset( $version_info['headers'] ) ) {
// Legacy ( < 2.1.1.14 ) version info contained the whole raw response.
$version_info = null;
}

if ( ! $raw_response ) {
if ( ! $version_info ) {
//Getting version number
$options = array( 'method' => 'POST', 'timeout' => 20 );
$options['headers'] = array(
'Content-Type' => 'application/x-www-form-urlencoded; charset=' . get_option( 'blog_charset' ),
'User-Agent' => 'WordPress/' . get_bloginfo( 'version' ),
'Referer' => get_bloginfo( 'url' )
'Referer' => get_bloginfo( 'url' ),
);
$options['body'] = self::get_remote_post_params();
$options['timeout'] = 15;
Expand All @@ -2112,19 +2138,18 @@ public static function get_version_info( $cache = true ) {

$raw_response = self::post_to_manager( 'version.php', $nocache, $options );

//caching responses.
set_transient( 'gform_update_info', $raw_response, 86400 ); //caching for 24 hours
}
if ( is_wp_error( $raw_response ) || rgars( $raw_response, 'response/code' ) != 200 ) {

if ( is_wp_error( $raw_response ) || rgars( $raw_response, 'response/code' ) != 200 ) {

return array( 'is_valid_key' => '1', 'version' => '', 'url' => '', 'is_error' => '1' );
}

$version_info = json_decode( $raw_response['body'], true );
$version_info = array( 'is_valid_key' => '1', 'version' => '', 'url' => '', 'is_error' => '1' );
} else {
$version_info = json_decode( $raw_response['body'], true );
if ( empty( $version_info ) ) {
$version_info = array( 'is_valid_key' => '1', 'version' => '', 'url' => '', 'is_error' => '1' );
}
}

if ( empty( $version_info ) ) {
return array( 'is_valid_key' => '1', 'version' => '', 'url' => '', 'is_error' => '1' );
// Caching response.
set_transient( 'gform_update_info', $version_info, 86400 ); //caching for 24 hours
}

return $version_info;
Expand Down Expand Up @@ -3296,10 +3321,28 @@ private static function get_akismet_field( $field_type, $form, $lead ) {
return $value;
}

public static function get_other_choice_value() {
$value = apply_filters( 'gform_other_choice_value', esc_html__( 'Other' , 'gravityforms' ) );
/**
* Get the placeholder to use for the radio button field other choice.
*
* @param null|GF_Field_Radio $field Null or the Field currently being prepared for display or being validated.
*
* @return string
*/
public static function get_other_choice_value( $field = null ) {
$placeholder = esc_html__( 'Other', 'gravityforms' );

return $value;
/**
* Filter the default placeholder for the radio button field other choice.
*
* @since 2.1.1.6 Added the $field parameter.
* @since Unknown
*
* @param string $placeholder The placeholder to be filtered. Defaults to "Other".
* @param null|GF_Field_Radio $field Null or the Field currently being prepared for display or being validated.
*/
$placeholder = apply_filters( 'gform_other_choice_value', $placeholder, $field );

return $placeholder;
}

public static function get_browser_class() {
Expand Down Expand Up @@ -4757,15 +4800,20 @@ public static function replace_field_variable( $text, $form, $lead, $url_encode,

if ( ! in_array( $field->type, array( 'html', 'section', 'signature' ) ) ) {
$value = self::encode_shortcodes( $value );
};
}

if ( $esc_attr ) {
$value = esc_attr( $value );
}

if ( $modifier == 'label' ) {
$value = empty( $value ) ? '' : $field->label;
} else if ( $modifier == 'qty' && $field->type == 'product' ) {
}
else if( $modifier == 'numeric' ) {
$number_format = $field->numberFormat ? $field->numberFormat : 'decimal_dot';
$value = self::clean_number( $value, $number_format );
}
else if ( $modifier == 'qty' && $field->type == 'product' ) {
// Getting quantity associated with product field.
$products = self::get_product_fields( $form, $lead, false, false );
$value = 0;
Expand Down Expand Up @@ -4969,6 +5017,11 @@ function start_el( &$output, $object, $depth = 0, $args = array(), $current_obje
$pad .= '&nbsp;';
}
$object->name = "{$pad}{$object->name}";

if( empty( $output ) ){
$output = array();
}

$output[] = $object;
}
}
Expand Down
48 changes: 47 additions & 1 deletion css/admin.css
Original file line number Diff line number Diff line change
Expand Up @@ -2933,6 +2933,20 @@ input.headercb {
width: 120px;
}

.gfield_rule_input{
vertical-align: bottom;
height: 28px;
}

.gf_conditional_logic_rules_container{
margin-top:4px;
}

.gf_conditional_logic_rules_container select, .gf_conditional_logic_rules_container input {
margin-top:0px!important;
margin-left:2px;
}

.gform_routing_operator{
width:60px;
}
Expand Down Expand Up @@ -4208,6 +4222,11 @@ div.gf_clear.gf_clear_complex {
cursor: pointer;
}

.gform-filter-value{
vertical-align: bottom;
height: 28px!important;
}

.gform-filter-value,
.gform-filter-field,
.gform-filter-operator {
Expand All @@ -4231,6 +4250,18 @@ div.gf_clear.gf_clear_complex {
overflow-y: auto;
}

.gform-field-filter{
margin-top:4px;
}

.gform-field-filter select, .gform-field-filter input{
margin-right:2px;
}

.gform-field-filter .gform-add{
margin-right:4px;
}

.ui-resizable-handle {
position: absolute;
font-size: 0.1px;
Expand Down Expand Up @@ -4465,10 +4496,24 @@ table tbody tr#gform_notification_to_email_container.notification_to_container t
width: 100% !important;
}

div#gform_notification_to_routing_rules div{
margin-top:4px;
}
div#gform_notification_to_routing_rules div:first-child{
margin-top:0px!important;
}

div#gform_notification_to_routing_rules div input:first-child {
min-width: 50%;
min-width: 35%;
}

div#gform_notification_to_routing_rules input {
height: 28px;
vertical-align: middle;
}



/* safari specific styles */

div.wrap.gf_browser_safari div#add_fields div#floatMenu ul#sidebarmenu1.menu li.add_field_button_container ul li.add-buttons ol.field_type li input.button,
Expand Down Expand Up @@ -4661,6 +4706,7 @@ div.wrap.gf_browser_chrome .gfield_checkbox li input {

#entry_search_button{
float:right;
margin-top:3px;
}

/* Entry Detail */
Expand Down
Loading

0 comments on commit 949c4f7

Please sign in to comment.