mirror of
https://github.com/alchemy-fr/Phraseanet.git
synced 2025-10-18 15:33:15 +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();
|
$selection = $helper->get_elements();
|
||||||
|
|
||||||
$metadatas = false;
|
$metadatas = false;
|
||||||
|
|
||||||
$record = null;
|
$record = null;
|
||||||
|
|
||||||
if (count($selection) == 1) {
|
if (count($selection) == 1) {
|
||||||
try {
|
|
||||||
|
|
||||||
$record = reset($selection);
|
$record = reset($selection);
|
||||||
|
|
||||||
|
if ( ! $record->is_grouping()) {
|
||||||
|
try {
|
||||||
|
|
||||||
$reader = new \PHPExiftool\Reader();
|
$reader = new \PHPExiftool\Reader();
|
||||||
$metadatas = $reader->files($record->get_subdef('document')->get_pathfile())
|
|
||||||
|
$metadatas = $reader
|
||||||
|
->files($record->get_subdef('document')->get_pathfile())
|
||||||
->first()->getMetadatas();
|
->first()->getMetadatas();
|
||||||
} catch (\PHPExiftool\Exception\Exception $e) {
|
} catch (\PHPExiftool\Exception\Exception $e) {
|
||||||
|
|
||||||
|
} catch (\Exception_Media_SubdefNotFound $e) {
|
||||||
|
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user