Skip to content
Snippets Groups Projects
Commit 8fb6670c authored by Tim Steiner's avatar Tim Steiner
Browse files

Editing a course creates a new generation of the course.

This should solve the problem of stale data in "View/Edit" from the home page.
parent 15c77d2e
No related branches found
No related tags found
No related merge requests found
...@@ -108,6 +108,8 @@ class NewRequestController extends Nmc_Controller_Action ...@@ -108,6 +108,8 @@ class NewRequestController extends Nmc_Controller_Action
$request = Requests::getInstance()->find($requestId); $request = Requests::getInstance()->find($requestId);
$course = $request->getCourseGeneration(); $course = $request->getCourseGeneration();
$course = clone $course;
Nmc_Registry_Session::getInstance()->course = $course; Nmc_Registry_Session::getInstance()->course = $course;
Nmc_Registry_Session::getInstance()->request = $request; Nmc_Registry_Session::getInstance()->request = $request;
......
...@@ -21,6 +21,14 @@ class Asset extends Nmc_Db_Table_Row ...@@ -21,6 +21,14 @@ class Asset extends Nmc_Db_Table_Row
parent::_save(); parent::_save();
} }
protected function _clone()
{
parent::_clone();
$this->creationTime = time();
$this->modifiedTime = time();
}
public function getAssetId() public function getAssetId()
{ {
return $this->getPrimaryKey(); return $this->getPrimaryKey();
......
...@@ -50,7 +50,7 @@ class Request extends Nmc_Db_Table_Row ...@@ -50,7 +50,7 @@ class Request extends Nmc_Db_Table_Row
. Assets::getInstance()->getTableName() . '.' . Assets::getInstance()->getTableName() . '.'
. Assets::getInstance()->getPrimaryKeyName()); . Assets::getInstance()->getPrimaryKeyName());
$select->where($this->_db->quoteInto('request = ?', $this->getPrimaryKey())); $select->where($this->_db->quoteInto('request = ?', $this->getPrimaryKey()));
$select->order('creation_time'); $select->order('creation_time DESC');
$generations = $this->_db->fetchCol($select); $generations = $this->_db->fetchCol($select);
if(count($generations) > 0) { if(count($generations) > 0) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment