diff --git a/lib/Alchemy/Phrasea/Controller/Prod/Tools.php b/lib/Alchemy/Phrasea/Controller/Prod/Tools.php index 66cd544cbd..c0f5ef05ae 100644 --- a/lib/Alchemy/Phrasea/Controller/Prod/Tools.php +++ b/lib/Alchemy/Phrasea/Controller/Prod/Tools.php @@ -205,13 +205,13 @@ class Tools implements ControllerProviderInterface , $request->get('record_id') ); - $media = $app['Core']['mediavorus']->guess($file); + $media = $app['Core']['mediavorus']->guess(new \SplFileInfo($tmpFile)); $record->substitute_subdef('thumbnail', $media); $success = true; } catch (\Exception $e) { - $errorMessage = $e->getMessage(); + $errorMessage = _('An error occured'); } } else { $errorMessage = _('file is not valid'); diff --git a/templates/web/prod/actions/Tools/index.html.twig b/templates/web/prod/actions/Tools/index.html.twig index 2016ac3617..6d4c8964b2 100644 --- a/templates/web/prod/actions/Tools/index.html.twig +++ b/templates/web/prod/actions/Tools/index.html.twig @@ -57,7 +57,7 @@ {% endif %} - {% if selectionLength == 1 and registry.get('GV_seeOngChgDoc') %} + {% if selectionLength == 1 and (registry.get('GV_seeOngChgDoc') or registry.get('GV_seeNewThumb')) %}