In a few places, when you get sent back from course/modedit.php to course/view.php, it adds "#section-".$cw->section to send you back to the appropriate part of the course page. There are a number of other places where it does not bother to do that.
This patch adds the missing "#section-".$cw->section bits.
Note that I chose to do a minimal patch, rather than changing everything to use moodle_url. Let me know if you would rather I did this differently.