From 6fe72833d08f58d2eb7361e5d11ec0e9e8ac217d Mon Sep 17 00:00:00 2001 From: cap2501 Date: Tue, 29 Aug 2006 01:35:45 +0000 Subject: [PATCH] Fixed errors in refactoring --- course/format/topics/commands.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/course/format/topics/commands.php b/course/format/topics/commands.php index ac1ff4deee..95453b2b86 100644 --- a/course/format/topics/commands.php +++ b/course/format/topics/commands.php @@ -12,7 +12,7 @@ $field = required_param('field', PARAM_ALPHA); $instanceid = optional_param('instanceId', 0, PARAM_INT); $value = optional_param('value', 0, PARAM_INT); -$weight = optional_param('weight', 0, PARAM_INT); +$column = optional_param('weight', 0, PARAM_ALPHA); $id = optional_param('id', 0, PARAM_INT); $summary = optional_param('summary', '', PARAM_INT); $sequence = optional_param('sequence', '', PARAM_INT); @@ -48,8 +48,8 @@ switch ($class) { case 'position': $dataobject->id = $instanceid; - $dataobject->position = $value; - $dataobject->weight = $weight; + $dataobject->position = $column; + $dataobject->weight = $value; if (!update_record('block_instance',$dataobject)) { error('Failed to update block!'); } @@ -60,7 +60,7 @@ switch ($class) { case 'section': - if ($dataobject->id = get_field('course_sections','id','course',$course->id,'section',$id)) { + if (!$dataobject->id = get_field('course_sections','id','course',$course->id,'section',$id)) { error('Bad Section ID'); } -- 2.39.5