Salesforce SSO cannot load more than 200 forms
-
Hi Pardot support team,
There is a bug in the plugin version 1.5.1 related to pagination. Using Salesforce SSO authentication, the ‘offset’ value is set in the header, but it should be part of the URL, see the documentation here: https://developer.pardot.com/kb/api-version-4/campaigns/
The issue is visible only when you have more than 200 campaigns or forms in your account. For example we have over 800 and our forms are not loaded properly on our website due this bug.
The wrong offset is used on pardot/includes/pardot-api-class.php line #566-#570:
else if ($this->auth_type == 'sso') { $headers = array( 'Authorization' => 'Bearer ' . $this->api_key, 'Pardot-Business-Unit-Id' => $this->business_unit_id, 'offset' => $paged > 1 ? ($paged - 1) * 200 : 0 ); $http_response = wp_remote_post( $this->_get_url( $item_type, $args ), array( 'timeout' => '30', 'redirection' => '5', 'method' => 'POST', 'blocking' => true, 'compress' => false, 'decompress' => true, 'sslverify' => false, 'headers' => $headers ) ); }
This the correct implementation:
else if ($this->auth_type == 'sso') { $offset = $paged > 1 ? ($paged - 1) * 200 : 0; $headers = array( 'Authorization' => 'Bearer ' . $this->api_key, 'Pardot-Business-Unit-Id' => $this->business_unit_id, ); $api_url = $this->_get_url( $item_type, $args ); $api_url = $offset > 0 ? add_query_arg( 'offset', $offset, $api_url ) : $api_url; $http_response = wp_remote_post( $api_url, array( 'timeout' => '30', 'redirection' => '5', 'method' => 'POST', 'blocking' => true, 'compress' => false, 'decompress' => true, 'sslverify' => false, 'headers' => $headers ) ); }
Hopefully you can release a fix for this soon.
Thanks
- The topic ‘Salesforce SSO cannot load more than 200 forms’ is closed to new replies.