public function saveToSessionAction()
{
if ($this->getParam("id")) {
$key = "document_" . $this->getParam("id");
$session = Session::get("pimcore_documents");
if (!($document = $session->{$key})) {
$document = Model\Document::getById($this->getParam("id"));
$document = $this->getLatestVersion($document);
}
// set _fulldump otherwise the properties will be removed because of the session-serialize
$document->_fulldump = true;
$this->setValuesToDocument($document);
$session->{$key} = $document;
Session::writeClose();
}
$this->_helper->json(["success" => true]);
}