PHRAS-1158_STAMP-CHANGE-COLL

fix : the stamp was not updated when a record changed of collection
#time 2h
This commit is contained in:
Jean-Yves Gaulier
2016-06-15 19:50:03 +02:00
parent 41334c5421
commit 51ff2e040a
4 changed files with 20 additions and 12 deletions

View File

@@ -475,6 +475,10 @@ class record_adapter implements RecordInterface, cache_cacheableInterface
return $this;
}
// remove stamp BEFORE changing collection since it uses the collection id :(
// todo : change clearStampCache() to be agnostic of collection
$this->clearStampCache();
$sql = "UPDATE record SET moddate = NOW(), coll_id = :coll_id WHERE record_id =:record_id";
$params = [
@@ -993,6 +997,8 @@ class record_adapter implements RecordInterface, cache_cacheableInterface
$this->set_metadata($param, $this->getDatabox());
}
$this->clearStampCache();
$xml = new DOMDocument();
$xml->loadXML($this->app['serializer.caption']->serialize($this->get_caption(), CaptionSerializer::SERIALIZE_XML, true));
@@ -1292,6 +1298,12 @@ class record_adapter implements RecordInterface, cache_cacheableInterface
return null;
}
public function clearStampCache()
{
$this->getCollection()->reset_stamp($this->getRecordId());
}
/**
* @return array[] list of deleted files real paths
*/