fix #655 No metas for grouping record

fix #654 Toolbox error when file has no subdef
This commit is contained in:
Nicolas Le Goff
2012-05-25 20:41:23 +02:00
parent 0b1321d13d
commit b507c11d83

View File

@@ -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) {
}
}
}