Skip to content

Commit

Permalink
Merge pull request #66 from katzwebservices/fix-manual-export-hook-order
Browse files Browse the repository at this point in the history
2.6.4.1 fixes manual export when updating entry and the opt-in value was...
  • Loading branch information
zackkatz committed Mar 21, 2014
2 parents 15d3714 + 210bd4b commit 5f8ecab
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 7 deletions.
6 changes: 6 additions & 0 deletions trunk/readme.txt
Original file line number Diff line number Diff line change
Expand Up @@ -239,6 +239,9 @@ This plugin is released under a GPL license.

== Changelog ==

= 2.6.4.1 (March 19, 2014) =
* Fixed (API Version): Entry update improvement when set to manually export to Salesforce

= 2.6.4 (February 20, 2014) =
* Fixed (API Version): Live Remote Field Mapping improvements
- Fixed endless spinning
Expand Down Expand Up @@ -390,6 +393,9 @@ This plugin is released under a GPL license.

== Upgrade Notice ==

= 2.6.4.1 (March 19, 2014) =
* Fixed (API Version): Entry update improvement when set to manually export to Salesforce

= 2.6.4 (February 20, 2014) =
* Fixed (API Version): Live Remote Field Mapping improvements
- Fixed endless spinning
Expand Down
14 changes: 10 additions & 4 deletions trunk/salesforce-api.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
Plugin Name: Gravity Forms Salesforce API Add-On
Plugin URI: https://katz.co/plugins/gravity-forms-salesforce/
Description: Integrates <a href="http://formplugin.com?r=salesforce">Gravity Forms</a> with Salesforce allowing form submissions to be automatically sent to your Salesforce account. Requires Salesforce API access. <strong>If you don't have API access</strong>, use the "Gravity Forms Salesforce - Web-to-Lead Add-On" plugin instead.
Version: 2.6.4
Version: 2.6.4.1
Requires at least: 3.3
Author: Katz Web Services, Inc.
Author URI: http://www.katzwebservices.com
Expand Down Expand Up @@ -38,7 +38,7 @@ class GFSalesforce {
private static $path = "gravity-forms-salesforce/salesforce-api.php";
private static $url = "http://formplugin.com";
private static $slug = "gravity-forms-salesforce";
private static $version = "2.6.4";
private static $version = "2.6.4.1";
private static $min_gravityforms_version = "1.3.9";
private static $is_debug = NULL;
private static $cache_time = 86400; // 24 hours
Expand Down Expand Up @@ -1599,7 +1599,12 @@ public static function manual_export( $form, $entry_id = NULL ) {
}

// Both admin_init and gforms_after_update_entry will have this set
if( empty( $_POST['gforms_save_entry'] ) || empty( $_POST['action'] ) || empty( $_POST['update_to_salesforce'] ) ) { return; }
if( empty( $_POST['gforms_save_entry'] ) || empty( $_POST['action'] ) ) { return; }

// Different checks since admin_init runs in both cases but we need to wait for entry update
$current_hook = current_filter();
if( $current_hook == 'admin_init' && empty( $_POST['send_to_salesforce'] ) ) { return; }
if( $current_hook == 'gform_after_update_entry' && empty( $_POST['update_to_salesforce'] ) ) { return; }

// Verify authenticity of request
check_admin_referer('gforms_save_entry', 'gforms_save_entry');
Expand Down Expand Up @@ -1642,6 +1647,7 @@ public static function manual_export( $form, $entry_id = NULL ) {

// Don't send twice.
unset($_POST['update_to_salesforce']);
unset($_POST['send_to_salesforce']);
}


Expand Down Expand Up @@ -1922,7 +1928,7 @@ public static function entry_info_send_to_salesforce_button( $button = '' ) {
$mode = empty($_POST["screen_mode"]) ? "view" : $_POST["screen_mode"];

if($mode === 'view') {
$button .= sprintf('<input type="hidden" name="update_to_salesforce" id="update_to_salesforce" value="" /><input type="submit" class="button button-large button-secondary alignright" value="%s" title="%s" onclick="jQuery(\'#update_to_salesforce\').val(\'1\'); jQuery(\'#action\').val(\'update_to_salesforce\')" />', esc_html__('Send to Salesforce', 'gravity-forms-salesforce'), esc_html__('Create or update this entry in Salesforce. The fields will be mapped according to the form feed settings.', 'gravity-forms-salesforce'));
$button .= sprintf('<input type="hidden" name="send_to_salesforce" id="send_to_salesforce" value="" /><input type="submit" class="button button-large button-secondary alignright" value="%s" title="%s" onclick="jQuery(\'#send_to_salesforce\').val(\'1\'); jQuery(\'#action\').val(\'send_to_salesforce\')" />', esc_html__('Send to Salesforce', 'gravity-forms-salesforce'), esc_html__('Create or update this entry in Salesforce. The fields will be mapped according to the form feed settings.', 'gravity-forms-salesforce'));
}

return $button;
Expand Down
4 changes: 2 additions & 2 deletions trunk/salesforce.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
/*
Plugin Name: Gravity Forms Salesforce - Web to Lead (**OLD VERSION**)
Description: This version is provided for backward compatibility only. Please use the new plugin, named "Gravity Forms Salesforce - Web-to-Lead Add-On". This version will be removed in the future.
Version: 2.6.4
Version: 2.6.4.1
Requires at least: 3.3
Author: Katz Web Services, Inc.
Author URI: http://www.katzwebservices.com
Expand Down Expand Up @@ -34,7 +34,7 @@ class GFSalesforceWebToLead {
private static $path = "gravity-forms-salesforce/salesforce.php";
private static $url = "http://www.gravityforms.com";
private static $slug = "gravity-forms-salesforce";
private static $version = "2.6.4";
private static $version = "2.6.4.1";
private static $min_gravityforms_version = "1.3.9";

//Plugin starting point. Will load appropriate files
Expand Down
2 changes: 1 addition & 1 deletion trunk/web-to-lead.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
Plugin Name: Gravity Forms Salesforce - Web-to-Lead Add-On
Plugin URI: https://katz.co/plugins/gravity-forms-salesforce/
Description: Integrate <a href="http://formplugin.com?r=salesforce">Gravity Forms</a> with Salesforce - form submissions are automatically sent to your Salesforce account! <strong>Requires Gravity Forms 1.7+</strong>.
Version: 2.6.4
Version: 2.6.4.1
Requires at least: 3.3
Author: Katz Web Services, Inc.
Author URI: http://www.katz.co
Expand Down

0 comments on commit 5f8ecab

Please sign in to comment.