diff --git a/application/modules/learningoutcomes/controllers/NewController.php b/application/modules/learningoutcomes/controllers/NewController.php index b177c124348e1fe53250734d4bc44f39707cafae..b72ebf6be2f13d72486ce08d96f4936acc24f8f8 100644 --- a/application/modules/learningoutcomes/controllers/NewController.php +++ b/application/modules/learningoutcomes/controllers/NewController.php @@ -27,7 +27,7 @@ class LearningOutcomes_NewController extends Creq_Controller_Action $request->setOwner($user); $request->setJustification('--None Required--'); - $learningOutcome = LearningOutcomes_LearningOutcomeModel::findByMajor($in['major']); + $learningOutcome = LearningOutcomes_LearningOutcomeModel::findByMajorId($in['major']); if (!$learningOutcome) { $learningOutcome = LearningOutcomes_LearningOutcomeModel::fetchNew(); $learningOutcome->setMajorId($in['major']); diff --git a/application/modules/learningoutcomes/models/LearningOutcomeModel.php b/application/modules/learningoutcomes/models/LearningOutcomeModel.php index 8a482ba5d7f0023eaf542236586927502bd8a290..4983cc8abaf6cf716e2069ab37eca8e8ef9578c3 100644 --- a/application/modules/learningoutcomes/models/LearningOutcomeModel.php +++ b/application/modules/learningoutcomes/models/LearningOutcomeModel.php @@ -266,15 +266,14 @@ class LearningOutcomes_LearningOutcomeModel extends Unl_Model return self::find($generationIds); } - static public function findByMajor($major) + static public function findByMajorId($majorId) { $db = Zend_Registry::get('db'); $select = new Zend_Db_Select($db); $select->from(array('g' => 'creqLearningOutcomeGenerations'), array('learningOutcomeGenerationId')); - $select->join(array('m' => 'creqMajors'), 'g.majorId = m.majorId', array('major' => 'name')); $select->join(array('f' => 'creqLearningOutcomes'), 'g.learningOutcomeGenerationId = f.currentGeneration', array()); - $select->where('m.name = ?', $major); + $select->where('g.majorId = ?', $majorId); $records = $select->query()->fetchAll(); if (count($records) == 0) {