Permalink
Browse files

MDL-45376 Completion: Form locking is still not working right

On submit of the form, it called 'freeze' on the completion-related
fields (even though they shouldn't have been frozen because you
already clicked the unlock button).
  • Loading branch information...
1 parent a76fb41 commit 62e02e583f2a54e3ea14207379da6ea4aa982b66 @sammarshallou sammarshallou committed May 1, 2014
Showing with 4 additions and 2 deletions.
  1. +4 −2 course/moodleform_mod.php
@@ -224,8 +224,10 @@ function definition_after_data() {
// is changed, maybe someone has completed it now)
$mform->getElement('completionunlocked')->setValue(1);
} else {
- // Has the element been unlocked?
- if ($mform->exportValue('unlockcompletion')) {
+ // Has the element been unlocked, either by the button being pressed
+ // in this request, or the field already being set from a previous one?
+ if ($mform->exportValue('unlockcompletion') ||
+ $mform->exportValue('completionunlocked')) {
// Yes, add in warning text and set the hidden variable
$mform->insertElementBefore(
$mform->createElement('static', 'completedunlocked',

0 comments on commit 62e02e5

Please sign in to comment.