Permalink
Browse files

made changes to the way the block movment was handled to eliminate so…

…me errors that came up.
  • Loading branch information...
1 parent 77e65ff commit bb781a70c536758f9532abf46b33319f7baeac61 cap2501 committed Oct 8, 2006
Showing with 2 additions and 9 deletions.
  1. +2 −9 course/rest.php
View
@@ -31,7 +31,6 @@
$PAGE = page_create_object(PAGE_COURSE_VIEW, $course->id);
$pageblocks = blocks_setup($PAGE,BLOCKS_PINNED_BOTH);
-
if (!empty($instanceid)) {
$blockinstance = blocks_find_instance($instanceid, $pageblocks);
if (!$blockinstance || $blockinstance->pageid != $course->id || $blockinstance->pagetype != 'course-view') {
@@ -57,14 +56,8 @@
break;
case 'position':
- $newblockinstance = new object;
- $newblockinstance->id = $blockinstance->id;
- $newblockinstance->position = $column;
- $newblockinstance->weight = $value;
- if (!update_record('block_instance',$newblockinstance)) {
- error_log('AJAX commands.php: Failed to update block with ID '.$blockinstance->id);
- die;
- }
+ //while not entirely restful this will handle all the details of moving a block
+ blocks_execute_repositioning_atomic($blockinstance, $column, $value);
break;
}
break;

0 comments on commit bb781a7

Please sign in to comment.