Problem/Motivation
There are numerous instances of getConfig() being called before token refreshes and hook calls in the ConstantContact.php file/service. For example, this ordering causes a problem when refreshToken() is called, and new tokens are generated and stored. In this state any subsequent HTTP request is made using the old/expired tokens.
Steps to reproduce
1. Setup CC and get the access and refresh tokens working in Drupal.
2. Visit the Lists page.
3. Check the log for "grant" errors.
Proposed resolution
Move all getConfig() calls to be as close to the HTTP request as possible. In cases when configs are needed sooner, re-pull the config before the HTTP request. Doing it this way instead of incorporating getTokens() since other config values may be changed. The provided patch does this.
Remaining tasks
Review and apply the patch.
User interface changes
n/a
API changes
Consumption of the CC API is updated to use the most recent tokens possible.
Data model changes
n/a
| Comment | File | Size | Author |
|---|---|---|---|
| getConfig_moves.patch | 11.71 KB | fractile81 |
Comments
Comment #2
rosemaryreilmanTaking a look, thanks for adding a patch
Comment #4
rosemaryreilmanAdded a pre-release for testing
https://www.drupal.org/project/ik_constant_contact/releases/3.1.10-rc1
Comment #6
rosemaryreilmanComment #7
rosemaryreilman