Upgrade from 3.3 to 3.4 broke our Enrolment block - Need help

Upgrade from 3.3 to 3.4 broke our Enrolment block - Need help

by Vladimir Miranovic -
Number of replies: 0

We developed an enrollment block, based upon self-enrollment, that appears on our sites landing page. Upon logging in, a student can enter an enrollment key into the block that will place them into a group in the correct course. The block validates the enrollment key, and if correct, takes the student to the main course page.

 

When upgrading our development server from Moodle 3.3 to 3.4, it was noticed that clients using the block experienced intermittent issues concerning membership in the group. They received the error “you are not a member of a group” when they attempted to use My Mail to contact their teacher. Even though they all appeared to belong to groups correctly on the enroller-users/participants’ page. My Mail is functioning normally after the student logs out and back in again.

 Also ther is one additional part of the code that we need to add to core moodle/enrol/renderer.php from line 40 to 80

/******************************************************************************/   
   
    function enrollment_key_search_form($value = '', $format = 'plain'){
        static $count = 0;
        $formid = 'enrolsearch';
        if ((++$count) > 1) {
            $formid .= $count;
        }
       
        switch ($format) {
            case 'navbar' :
                $formid = 'enrolsearchnavbar';
                $inputid = 'navenrolbox';
                $inputsize = 20;
                break;
            case 'short' :
                $inputid = 'shortsearchbox';
                $inputsize = 12;
                break;
            default :
                $inputid = 'enrolsearchbox';
                $inputsize = 30;
        }
       
        $strkeysearch= get_string("password", 'block_enrollment');
        $searchurl = new moodle_url('/blocks/enrollment/view.php');
       
        $output = html_writer::start_tag('form', array('id' => $formid, 'action' => $searchurl, 'method' => 'get'));
        $output .= html_writer::start_tag('fieldset', array('class' => 'enrolsearchbox invisiblefieldset'));
        $output .= html_writer::tag('label', $strkeysearch.': ', array('for' => $inputid));
        $output .= html_writer::empty_tag('input', array('type' => 'text', 'id' => $inputid,
            'size' => $inputsize, 'name' => 'search', 'value' => s($value)));
        $output .= html_writer::empty_tag('input', array('type' => 'submit',
            'value' => get_string('blocktitle', 'block_enrollment')));
        $output .= html_writer::end_tag('fieldset');
        $output .= html_writer::end_tag('form');

        return $output;
    }
       
/*******************************END *******************************************************/


Our code is attached. Any fixes or ideas on what we should consider will be appreciated!

 

Vlad

 

 


Average of ratings: -