Skip to content

Commit

Permalink
Merge branch 'hotfix/1.1.2'
Browse files Browse the repository at this point in the history
  • Loading branch information
qzminski committed Aug 29, 2019
2 parents ba01698 + 69efdd6 commit 25726f1
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/Codefog/Instagram/EventListener/ModuleListener.php
Expand Up @@ -126,7 +126,7 @@ private function requestAccessToken($clientId)
'client_id' => $clientId,
'redirect_uri' => $_SESSION['CFG_INSTAGRAM_URI'],
'response_type' => 'code',
'scope' => 'public_content',
'scope' => 'basic',
];

Controller::redirect('https://api.instagram.com/oauth/authorize/?' . http_build_query($data));
Expand Down
9 changes: 8 additions & 1 deletion src/Codefog/Instagram/FrontendModule/InstagramModule.php
Expand Up @@ -132,7 +132,14 @@ protected function getFeedItems()
return [];
}

$response = $this->sendRequest($endpoint, ['count' => $this->numberOfItems]);
$options = [];

// Set the limit only if greater than zero (#10)
if ($this->numberOfItems > 0) {
$options['count'] = $this->numberOfItems;
}

$response = $this->sendRequest($endpoint, $options);

if ($response === null) {
return [];
Expand Down

0 comments on commit 25726f1

Please sign in to comment.