diff --git a/lib/Alchemy/Phrasea/Controller/Prod/Bridge.php b/lib/Alchemy/Phrasea/Controller/Prod/Bridge.php index 26c6566f5d..d57f902db3 100644 --- a/lib/Alchemy/Phrasea/Controller/Prod/Bridge.php +++ b/lib/Alchemy/Phrasea/Controller/Prod/Bridge.php @@ -32,7 +32,8 @@ class Bridge implements ControllerProviderInterface }); $controllers - ->post('/manager/', 'bridge.controller:doPostManager'); + ->post('/manager/', 'bridge.controller:doPostManager') + ->bind('prod_bridge_manager'); $controllers ->get('/login/{api_name}/', 'bridge.controller:doGetLogin') diff --git a/lib/classes/Bridge/Api/Dailymotion.php b/lib/classes/Bridge/Api/Dailymotion.php index 135cf91b70..b79a03977e 100644 --- a/lib/classes/Bridge/Api/Dailymotion.php +++ b/lib/classes/Bridge/Api/Dailymotion.php @@ -425,7 +425,7 @@ class Bridge_Api_Dailymotion extends Bridge_Api_Abstract implements Bridge_Api_I return $this->get_container_from_id(self::CONTAINER_TYPE_PLAYLIST, $container_id); break; default: - throw new Bridge_Exception_ContainerUnknown('Unknown element ' . $destination); + throw new Bridge_Exception_ContainerUnknown('Unknown element ' . $container); break; } break; @@ -570,8 +570,8 @@ class Bridge_Api_Dailymotion extends Bridge_Api_Abstract implements Bridge_Api_I { switch ($record->get_type()) { case self::ELEMENT_TYPE_VIDEO : - $url_file = $this->_api->uploadFileWithToken($record->get_hd_file()->getRealPath(), $this->oauth_token); - $options = array_merge(['url' => $url_file], $options); + $url_file = $this->_api->sendFile($record->get_hd_file()->getRealPath(), $this->oauth_token); + $options = array_merge(array('url' => $url_file), $options); $video = $this->_api->call('POST /me/videos', $options, $this->oauth_token); return $video["id"]; diff --git a/lib/classes/Bridge/Api/Flickr.php b/lib/classes/Bridge/Api/Flickr.php index 2b402744b8..4b5a2be3a0 100644 --- a/lib/classes/Bridge/Api/Flickr.php +++ b/lib/classes/Bridge/Api/Flickr.php @@ -193,7 +193,7 @@ class Bridge_Api_Flickr extends Bridge_Api_Abstract implements Bridge_Api_Interf throw new Bridge_Exception_ApiConnectorRequestFailed('Unable to retrieve photoset infos for ' . $object); $xml = $response->getXml(); - $primary_photo = $this->get_element_from_id((string) $xml['primary'], self::ELEMENT_TYPE_PHOTO); + $primary_photo = $this->get_element_from_id((string) $xml->photo['id'], self::ELEMENT_TYPE_PHOTO); return new Bridge_Api_Flickr_Container($xml, $this->get_user_id(), $object, $primary_photo->get_thumbnail()); break; diff --git a/lib/classes/Bridge/Api/Interface.php b/lib/classes/Bridge/Api/Interface.php index 155029a613..f1ff28b84e 100644 --- a/lib/classes/Bridge/Api/Interface.php +++ b/lib/classes/Bridge/Api/Interface.php @@ -9,6 +9,7 @@ * file that was distributed with this source code. */ +use Symfony\Component\Routing\Generator\UrlGenerator; use Symfony\Component\HttpFoundation\Request; interface Bridge_Api_Interface diff --git a/lib/classes/DailymotionWithoutOauth2.php b/lib/classes/DailymotionWithoutOauth2.php index da4426dfc9..bdea752fbb 100644 --- a/lib/classes/DailymotionWithoutOauth2.php +++ b/lib/classes/DailymotionWithoutOauth2.php @@ -64,7 +64,7 @@ class DailymotionWithoutOauth2 extends Dailymotion * * @return String the resulting URL */ - public function uploadFileWithToken($filePath, $oauth_token) + public function sendFile($filePath, $oauth_token) { $result = $this->call('file.upload', [], $oauth_token); $timeout = $this->timeout; diff --git a/templates/web/prod/actions/Bridge/callback.html.twig b/templates/web/prod/actions/Bridge/callback.html.twig index 9e9ba966ac..d81f5a9a14 100644 --- a/templates/web/prod/actions/Bridge/callback.html.twig +++ b/templates/web/prod/actions/Bridge/callback.html.twig @@ -6,7 +6,7 @@ {% if error_message is empty %} diff --git a/templates/web/prod/actions/Bridge/index.html.twig b/templates/web/prod/actions/Bridge/index.html.twig index 9463407bb8..5abaf67728 100644 --- a/templates/web/prod/actions/Bridge/index.html.twig +++ b/templates/web/prod/actions/Bridge/index.html.twig @@ -1,7 +1,7 @@ {% import "common/thumbnail.html.twig" as thumb %} -