Skip to content
Snippets Groups Projects
Commit 9ba85c5a authored by Georgi's avatar Georgi
Browse files

[BUGFIX] Code review fixes

parent 8c79e51c
No related branches found
No related tags found
1 merge request!13Feature frontend filters
......@@ -127,12 +127,13 @@ class LicenceCheckService {
private static $versionToReleaseTimestamp = [
'3.0.0' => 1688468637, // Tue, 04 Jul 2023 14:11:50 GMT
'4.2.0' => 1717678615, // Tue, 06 Jun 2023 14:57:50 GMT
'5.0.0' => 1729271668, // Tue, 18 Oct 2024 20:15:50 GMT+3
];
/**
* The current extension version
*/
public const CURRENT_VERSION = '4.2.0';
public const CURRENT_VERSION = '5.0.0';
/**
* @param mixed $validUntil A timestamp, which says the lifetime of this key.
......
......@@ -184,9 +184,9 @@ class VimeoService implements LoggerAwareInterface {
* @param array|null $response
* @return array|null
*/
protected function addVideoIdsToResponse(?array $response): ?array {
if (!is_array($response)) {
return NULL;
protected function addVideoIdsToResponse(array $response): array {
if (empty($response)) {
return [];
}
foreach ($response as $index => $item) {
......@@ -222,9 +222,9 @@ class VimeoService implements LoggerAwareInterface {
* @param array|null $response
* @return array|null
*/
protected function preprocessApiResponse(?array $response): ?array {
if (!is_array($response)) {
return NULL;
protected function preprocessApiResponse(?array $response): array {
if (!is_array($response) || $response['status'] >= 400) {
return [];
}
// log error & return here, since the response was not OK
......@@ -288,7 +288,6 @@ class VimeoService implements LoggerAwareInterface {
try {
$response = $this->vimeoApiClient->request(self::API_VIDEO . $videoId . '?' . $query);
} catch (VimeoRequestException $e) {
$response = NULL;
throw $e;
}
......@@ -323,7 +322,6 @@ class VimeoService implements LoggerAwareInterface {
self::API_CHANNEL . $channelIdentifier . self::API_VIDEO . '?' . $query
);
} catch (VimeoRequestException $e) {
$response = NULL;
throw $e;
}
......@@ -360,7 +358,6 @@ class VimeoService implements LoggerAwareInterface {
self::API_SHOWCASE . $showcaseId . self::API_VIDEO . '?' . $query
);
} catch (VimeoRequestException $e) {
$response = NULL;
throw $e;
}
......
......@@ -326,6 +326,7 @@ Once it runs it will create the file and we can commit the new version and use i
1. In the plugin's FlexForm settings, you will see a section for "Filters."
2. Depending on your site configuration, filters will be available in a select field. You can select the filters you want to display (like search term, video duration, etc.).
3. Save your settings and publish the page.
4. IMPORTANT! You must make sure that the user associated with the clientId and clientSecret API keys has the right permissions to search in the channel where the filters are being used. Otherwise searching for a query string will always result in an empty result set.
---
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment