Fix bug #2334 - New unique undes in course table causes course move to fail
Fix bug #2334 - New unique undes in course table causes course move to fail

There were several issues in fix_coursesortorder() that were fixed. Mainly:
 - the recursive calls dropped the $safe parameter
 - we did not even try to maintain uniqueness in the sortorder field across categories

http://moodle.org/bugs/bug.php?op=show&bugid=2334

dilawar/moodle