public function diffVersionsAction()
{
Pimcore\Model\Object\AbstractObject::setDoNotRestoreKeyAndPath(true);
$id1 = intval($this->getParam("from"));
$id2 = intval($this->getParam("to"));
$version1 = Model\Version::getById($id1);
$object1 = $version1->loadData();
$version2 = Model\Version::getById($id2);
$object2 = $version2->loadData();
Pimcore\Model\Object\AbstractObject::setDoNotRestoreKeyAndPath(false);
if ($object1 && $object2) {
if ($object1->isAllowed("versions") && $object2->isAllowed("versions")) {
$this->view->object1 = $object1;
$this->view->object2 = $object2;
} else {
throw new \Exception("Permission denied, version ids [" . $id1 . ", " . $id2 . "]");
}
} else {
throw new \Exception("Version with ids [" . $id1 . ", " . $id2 . "] doesn't exist");
}
}