mirror of
https://github.com/alchemy-fr/Phraseanet.git
synced 2025-10-17 15:03:25 +00:00
fix #1095 : task archive crashed
This commit is contained in:
@@ -1625,6 +1625,7 @@ class task_period_archive extends task_abstract
|
||||
$metadatasStructure = $databox->get_meta_structure();
|
||||
|
||||
$metadatas = $this->getIndexByFieldName($metadatasStructure, $media->getEntity()->getMetadatas());
|
||||
$metaFields = null;
|
||||
|
||||
if ($captionFile !== null && true === $this->filesystem->exists($captionFile)) {
|
||||
$metaFields = $this->readXMLForDatabox($metadatasStructure, $captionFile);
|
||||
@@ -1639,8 +1640,9 @@ class task_period_archive extends task_abstract
|
||||
$story->substitute_subdef('document', $media);
|
||||
|
||||
$story->set_metadatas($metadatas->toMetadataArray($metadatasStructure), true);
|
||||
$story->set_metadatas($metaFields->toMetadataArray($metadatasStructure), true);
|
||||
|
||||
if ($metaFields) {
|
||||
$story->set_metadatas($metaFields->toMetadataArray($metadatasStructure), true);
|
||||
}
|
||||
$story->set_binary_status(databox_status::operation_or($stat0, $stat1));
|
||||
$story->rebuild_subdefs();
|
||||
$story->reindex();
|
||||
@@ -1690,6 +1692,7 @@ class task_period_archive extends task_abstract
|
||||
|
||||
$metadatas = $this->getIndexByFieldName($metadatasStructure, $media->getEntity()->getMetadatas());
|
||||
|
||||
$metaFields = array();
|
||||
if ($captionFile !== null && true === $this->filesystem->exists($captionFile)) {
|
||||
$metaFields = $this->readXMLForDatabox($metadatasStructure, $captionFile);
|
||||
$captionStatus = $this->parseStatusBit(@simplexml_load_file($captionFile));
|
||||
|
Reference in New Issue
Block a user