PHRAS-2329 Port to master : log_doc error when move a record between collections (#2867)

* port PHRAS-2317 fix: wrong coll_id in log_docs when move collection

* update
This commit is contained in:
aynsix
2018-12-26 12:41:09 +04:00
committed by jygaulier
parent 331127d091
commit c20d385292
3 changed files with 70 additions and 4 deletions

View File

@@ -530,11 +530,12 @@ class record_adapter implements RecordInterface, cache_cacheableInterface
}
$coll_id_from = $this->getCollectionId();
$coll_id_to = $collection->get_coll_id();
$sql = "UPDATE record SET moddate = NOW(), coll_id = :coll_id WHERE record_id =:record_id";
$params = [
':coll_id' => $collection->get_coll_id(),
':coll_id' => $coll_id_to,
':record_id' => $this->getRecordId(),
];
@@ -543,12 +544,13 @@ class record_adapter implements RecordInterface, cache_cacheableInterface
$stmt->closeCursor();
$this->base_id = $collection->get_base_id();
$this->collection_id = $coll_id_to;
$this->delete_data_from_cache();
$this->app['phraseanet.logger']($this->getDatabox())
->log($this, Session_Logger::EVENT_MOVE, $collection->get_coll_id(), '', $coll_id_from);
$this->delete_data_from_cache();
$this->dispatch(RecordEvents::COLLECTION_CHANGED, new CollectionChangedEvent($this));
return $this;