Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Config-Values will not be saved when only userkey is available #11

Open
mageconsult opened this issue May 19, 2015 · 2 comments
Open

Config-Values will not be saved when only userkey is available #11

mageconsult opened this issue May 19, 2015 · 2 comments
Assignees
Labels
Milestone

Comments

@mageconsult
Copy link

Having only a userkey instead of the api-secretkey will not allow to save config values in magento backend.

app/code/community/Gigya/Social/sdk/gigyaCMS.php
row 340:
public function testApiconfig() {
$request = new GSRequest($this->api_key, $this->api_secret, 'shortenURL');

will only use $this-api_secret and doesn´t care about user-secret.

As a result the call of the following line in Gigya_Social_Model_Config_Backend_ApiKey will throw an exception:
if ($apiError = $helper->utils->testApiconfig()) {

and no values will be saved. As a short test I disabled the call to testApiconfig() and then values will be saved.

@mageconsult
Copy link
Author

The correct code should be:

public function testApiconfig() {
    if ($this->useUserKey) {
        $request = new GSRequest( $this->api_key, $this->user_secret, 'shortenURL', null, false, $this->user_key );
    } else {
        $request = new GSRequest( $this->api_key, $this->api_secret, 'shortenURL' );
    }

@luciodiri
Copy link
Contributor

Thanks @mageconsult!
We will incorporate the fix or a variation on the solution in the upcoming module version.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants