Fix for Bug #5588 - Editing a question after sorting leads to an error. Merged from 1.6stable.
Fix for Bug #5588 - Editing a question after sorting leads to an error. Merged from 1.6stable.

dilawar/moodle