mirror of
https://github.com/alchemy-fr/Phraseanet.git
synced 2025-10-18 07:23:13 +00:00
fix #1095 : task archive crashed
This commit is contained in:

committed by
Romain Neutron

parent
4c4ebb6a8a
commit
a29a1e5055
@@ -1929,7 +1929,8 @@ class record_adapter implements record_Interface, cache_cacheableInterface
|
||||
throw new Exception('This record is not a grouping');
|
||||
}
|
||||
|
||||
$sql = 'SELECT record_id
|
||||
if ($this->app['phraseanet.user']) {
|
||||
$sql = 'SELECT record_id
|
||||
FROM regroup g
|
||||
INNER JOIN (record r
|
||||
INNER JOIN collusr c
|
||||
@@ -1942,11 +1943,22 @@ class record_adapter implements record_Interface, cache_cacheableInterface
|
||||
ON (g.rid_child = r.record_id AND g.rid_parent = :record_id)
|
||||
ORDER BY g.ord ASC, dateadd ASC, record_id ASC';
|
||||
|
||||
$params = array(
|
||||
':GV_site' => $this->app['phraseanet.registry']->get('GV_sit')
|
||||
, ':usr_id' => $this->app['phraseanet.user']->get_id()
|
||||
, ':record_id' => $this->get_record_id()
|
||||
);
|
||||
$params = array(
|
||||
':GV_site' => $this->app['phraseanet.registry']->get('GV_sit'),
|
||||
':usr_id' => $this->app['phraseanet.user']->get_id(),
|
||||
':record_id' => $this->get_record_id(),
|
||||
);
|
||||
} else {
|
||||
$sql = 'SELECT record_id
|
||||
FROM regroup g
|
||||
INNER JOIN record r
|
||||
ON (g.rid_child = r.record_id AND g.rid_parent = :record_id)
|
||||
ORDER BY g.ord ASC, dateadd ASC, record_id ASC';
|
||||
|
||||
$params = array(
|
||||
':record_id' => $this->get_record_id()
|
||||
);
|
||||
}
|
||||
|
||||
$stmt = $this->get_databox()->get_connection()->prepare($sql);
|
||||
$stmt->execute($params);
|
||||
|
@@ -1611,6 +1611,7 @@ class task_period_archive extends task_abstract
|
||||
$metadatasStructure = $databox->get_meta_structure();
|
||||
|
||||
$metadatas = $this->getIndexByFieldName($metadatasStructure, $media->getMetadatas());
|
||||
$metaFields = null;
|
||||
|
||||
if ($captionFile !== null && true === $this->dependencyContainer['filesystem']->exists($captionFile)) {
|
||||
$metaFields = $this->readXMLForDatabox($metadatasStructure, $captionFile);
|
||||
@@ -1625,7 +1626,10 @@ class task_period_archive extends task_abstract
|
||||
$story->substitute_subdef('document', $media, $this->dependencyContainer);
|
||||
|
||||
$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($this->dependencyContainer, $stat0, $stat1));
|
||||
$story->rebuild_subdefs();
|
||||
@@ -1676,6 +1680,7 @@ class task_period_archive extends task_abstract
|
||||
|
||||
$metadatas = $this->getIndexByFieldName($metadatasStructure, $media->getMetadatas());
|
||||
|
||||
$metaFields = array();
|
||||
if ($captionFile !== null && true === $this->dependencyContainer['filesystem']->exists($captionFile)) {
|
||||
$metaFields = $this->readXMLForDatabox($metadatasStructure, $captionFile);
|
||||
$captionStatus = $this->parseStatusBit(@simplexml_load_file($captionFile));
|
||||
|
Reference in New Issue
Block a user