Support » Plugin: Gravity Forms Salesforce Add-on » Plugin does not to Salesforce Web to Lead URL (Here’s how to fix it)

  • Resolved tison_

    (@tison_)


    Guys/gals,
    First thank you for the amazing plugin, we’ve used for years.

    Second – Salesforce just finally deprecated the old web to lead url – so your plugin, currently, does not work (does not connect to web to lead form url).

    This is the announcement by sf:
    https://help.salesforce.com/articleView?id=Updating-the-Web-to-Case-and-Web-to-Lead-Endpoint-URL&language=en_US&type=1

    For now, to fix this, we’ve patched the plugin files:
    plugins/Gravity forms salesforce/inc/web-to-lead.php

    And change this line:
    $sub = apply_filters( ‘gf_salesforce_request_subdomain’, ($test ? ‘test’ : ‘www’), $test );

    to this:

    $sub = apply_filters( ‘gf_salesforce_request_subdomain’, ($test ? ‘test’ : ‘webto’), $test );

    PLEASE NOTE
    If you make this change, and the plugin upgrades (without making this fix) your changes will be lost, recommend you add a note to the plugin page (or alert your web editor team how to reproduce this if the plugin is upgraded or re-installed).

    Let us know when this is fixed and thank you again for the great plugin,
    T

    • This topic was modified 1 year, 5 months ago by  tison_.
    • This topic was modified 1 year, 5 months ago by  tison_.
Viewing 15 replies - 1 through 15 (of 21 total)
  • Hey Tison,

    Weve also been using this plugin for years and know this doesnt appear to be supported anymore so its great that ppl like you are sharing this knowledge with others on how to fix.

    Ive made the code edit on line 711 but we still arent seeing leads populating within Salesforce?

    Just wondered if theres anything else that needs to be done to get this working again?

    Thanks again in advance for any pointers you can provide, really appreciate it.

    Cheers
    Damien

    Plugin Author gravity+

    (@gravityplus)

    The plugin upgrade is available here: https://gravityplus.pro/gravity-forms-salesforce/

    Its not working for me either

    @dsamwell & @aruncappi

    A few things to note:

    1) Are you making sure to refresh your website’s cache (are you seeing the latest?) The url in the browser should contain “webto.salesforce.com” when you visit it.

    2) It may be the copy / paste out of this page, let me paste the code again here in an actual code block:

    Change this line:
    And change this line:
    $sub = apply_filters( ‘gf_salesforce_request_subdomain’, ($test ? ‘test’ : ‘www’), $test );

    to this:

    $sub = apply_filters( ‘gf_salesforce_request_subdomain’, ($test ? ‘test’ : ‘webto’), $test );

    Thanks, cache cleared – browser and website, no joy
    Code is as per your code blocks…..

    I dont see webto.salesforce.com at all during the form submission process…..

    Interesingly…. in web to lead setup the salesforce company ID is no longer bein accepted, and going into salesforce it is definitely correct…..

    @aruncappi – install the gravity forms logging plugin (or turn on logging if you have a newer version of gf) and check your logs – you might see an error message in there..

    2018-05-15 12:33:04.255435 – ERROR –> There was an error adding the entry to Salesforce: cURL error 6: Could not resolve host: xn--test-p96ak.salesforce.com
    2018-05-15 12:33:04.262908 – DEBUG –> This is the data sent to Salesforce (at https://‘test’.salesforce.com/servlet/servlet.WebToLead?encoding=UTF-8:
    Array

    And this is the only change I have made:
    // Use test/www subdomain based on whether this is a test or live
    $sub = apply_filters( ‘gf_salesforce_request_subdomain’, ($test ? ‘test’ : ‘webto’), $test );

    Hang on, noticed the single quotes are different to the rest of the quote in your snippets, will try changing

    • This reply was modified 1 year, 5 months ago by  aruncappi.

    Fixed!
    In your code change you have a curly single quote, which is different to the rest of the code with a straight single quote.
    It seems to be relating to the way this wordpress.org site saves single quotes!

    • This reply was modified 1 year, 5 months ago by  aruncappi.
    • This reply was modified 1 year, 5 months ago by  aruncappi.
    • This reply was modified 1 year, 5 months ago by  aruncappi.
    • This reply was modified 1 year, 5 months ago by  aruncappi.

    Fixed also! Thanks aruncappi, changing the curly brackets also worked for me. Thanks to everyone else for helping too with this issue.

    Guys,
    It looks like this forum uses single quotes for code brackets, and I’m unable to edit either of my previous posts, so posting again here w/ double quotes, this should paste correctly:

    $sub = apply_filters( "gf_salesforce_request_subdomain", ($test ? "test" : "webto"), $test );

    Note that all you’re changing is the “www” to “webto” in that line.

    • This reply was modified 1 year, 5 months ago by  tison_.
    Michael Beckwith

    (@tw2113)

    The BenchPresser

    For those who would prefer to not edit the plugin files directly, and instead use the filter that the developer conveniently provided, try out the following snippet. Mind the curly quotes that will potentially be added.

    Add the following to your active theme’s functions.php file.

    function hotfix_gforms_web_to_lead( $subdomain, $test ) {
    	// We will disregard the original subdomain value, which is legacy "www".
    	return ( $test ) ? 'test' : 'webto';
    }
    add_filter( 'gf_salesforce_request_subdomain', 'hotfix_gforms_web_to_lead', 10, 2 );
    

    This will provide safe editing in the event they do update without addressing this topic, and you won’t have to go re-apply the edit again.

    Well done @tw2113.

Viewing 15 replies - 1 through 15 (of 21 total)
  • The topic ‘Plugin does not to Salesforce Web to Lead URL (Here’s how to fix it)’ is closed to new replies.