diff --git a/lib/Alchemy/Phrasea/PhraseanetService/Controller/PSExposeController.php b/lib/Alchemy/Phrasea/PhraseanetService/Controller/PSExposeController.php index b202679d40..63f4d25cac 100644 --- a/lib/Alchemy/Phrasea/PhraseanetService/Controller/PSExposeController.php +++ b/lib/Alchemy/Phrasea/PhraseanetService/Controller/PSExposeController.php @@ -1355,7 +1355,7 @@ private function getAndSaveToken($exposeName) $accessToken = $tokenInfo['access_token']; } elseif (is_array($tokenInfo) && $tokenInfo['expires_at'] > time()) { $accessToken = $tokenInfo['access_token']; - } elseif (is_array($tokenInfo) && $tokenInfo['expires_at'] <= time() && $tokenInfo['refresh_expires_at'] > time()) { + } elseif (is_array($tokenInfo) && $tokenInfo['expires_at'] <= time() && isset($tokenInfo['refresh_expires_at']) && $tokenInfo['refresh_expires_at'] > time()) { $resToken = $this->refreshToken($oauthClient, $config, $tokenInfo['refresh_token']); if ($resToken->getStatusCode() !== 200) { diff --git a/lib/Alchemy/Phrasea/WorkerManager/Worker/ExposeUploadWorker.php b/lib/Alchemy/Phrasea/WorkerManager/Worker/ExposeUploadWorker.php index 41bbd14188..bd72160259 100644 --- a/lib/Alchemy/Phrasea/WorkerManager/Worker/ExposeUploadWorker.php +++ b/lib/Alchemy/Phrasea/WorkerManager/Worker/ExposeUploadWorker.php @@ -225,6 +225,7 @@ public function process(array $payload) 'publication_id' => $payload['publicationId'], 'description' => $description, 'asset_id' => $assetId, + 'title' => $record->get_title(), 'upload' => [ 'type' => $record->get_subdef($phraseanetSubdefAsDocument)->get_mime(), 'size' => $record->get_subdef($phraseanetSubdefAsDocument)->get_size(), @@ -472,9 +473,9 @@ private function getToken() if ($this->exposeConfiguration['connection_kind'] == 'password') { if (!isset($this->accessTokenInfo['expires_at'])) { return $this->accessTokenInfo['access_token']; - } elseif ($this->accessTokenInfo['expires_at'] > time() && $this->accessTokenInfo['refresh_expires_at'] > time()) { + } elseif ($this->accessTokenInfo['expires_at'] > time()) { return $this->accessTokenInfo['access_token']; - } elseif ($this->accessTokenInfo['expires_at'] <= time() && $this->accessTokenInfo['refresh_expires_at'] > time()) { + } elseif ($this->accessTokenInfo['expires_at'] <= time() && isset($tokenInfo['refresh_expires_at']) && $this->accessTokenInfo['refresh_expires_at'] > time()) { $resToken = $oauthClient->post($this->exposeConfiguration['oauth_token_uri'], [ 'form_params' => [ 'client_id' => $this->exposeConfiguration['auth_client_id'], diff --git a/templates/web/admin/phraseanet-service/expose.html.twig b/templates/web/admin/phraseanet-service/expose.html.twig index c9750bc95f..18cfc39528 100644 --- a/templates/web/admin/phraseanet-service/expose.html.twig +++ b/templates/web/admin/phraseanet-service/expose.html.twig @@ -48,7 +48,7 @@ {{ form_row(form.expose_client_id) }} -