Improved handling of occupied target issue

If the target area already contains a form, we can't pick anything to
use there. If the user works in two windows or there are several
teachers modifying the same course, it can happen that the form suddenly
appears in the target area while we have the form picker still open. In
such case, we simply redirects the user to the target area instead of
displaying the pooky exception.
This commit is contained in:
David Mudrak 2011-11-02 22:29:47 +01:00
parent 9e4eb676e4
commit 9e3d352dee

View File

@ -47,7 +47,7 @@ $targetcontrollerclass = get_class($targetcontroller);
// make sure there is no such form defined in the target area
if ($targetcontroller->is_form_defined()) {
throw new moodle_exception('target_defined', 'core_grading');
redirect(new moodle_url('/grade/grading/manage.php', array('areaid' => $targetid)));
}
list($context, $course, $cm) = get_context_info_array($targetmanager->get_context()->id);