mirror of
https://github.com/alchemy-fr/Phraseanet.git
synced 2025-10-17 15:03:25 +00:00
fix #655 No metas for grouping record
fix #654 Toolbox error when file has no subdef
This commit is contained in:
@@ -38,18 +38,26 @@ class Tools implements ControllerProviderInterface
|
||||
$selection = $helper->get_elements();
|
||||
|
||||
$metadatas = false;
|
||||
|
||||
$record = null;
|
||||
|
||||
if (count($selection) == 1) {
|
||||
try {
|
||||
|
||||
$record = reset($selection);
|
||||
$record = reset($selection);
|
||||
|
||||
$reader = new \PHPExiftool\Reader();
|
||||
$metadatas = $reader->files($record->get_subdef('document')->get_pathfile())
|
||||
->first()->getMetadatas();
|
||||
} catch (\PHPExiftool\Exception\Exception $e) {
|
||||
if ( ! $record->is_grouping()) {
|
||||
try {
|
||||
|
||||
$reader = new \PHPExiftool\Reader();
|
||||
|
||||
$metadatas = $reader
|
||||
->files($record->get_subdef('document')->get_pathfile())
|
||||
->first()->getMetadatas();
|
||||
} catch (\PHPExiftool\Exception\Exception $e) {
|
||||
|
||||
} catch (\Exception_Media_SubdefNotFound $e) {
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user