Uploaded image for project: 'Moodle'
  1. Moodle
  2. MDL-60205

Regression in formslib: hideIf on an element inside a group hides the whole group (Clean only)

    XMLWordPrintable

    Details

    • Testing Instructions:
      Hide
      • Place the attached test60205.php in your wwwroot
      • Set site theme to Clean
      • Visit [site]/test60205.php
      • Tick + untick the checkbox
        • The textbox should be hidden, but not the entire group that contains it
      Show
      Place the attached test60205.php in your wwwroot Set site theme to Clean Visit [site] /test60205.php Tick + untick the checkbox The textbox should be hidden, but not the entire group that contains it
    • Affected Branches:
      MOODLE_34_STABLE
    • Fixed Branches:
      MOODLE_34_STABLE
    • Pull Master Branch:
      MDL-60205_group_hiding_clean

      Description

      Here is a simple group in a form where second element (text input) is hidden unless the first element (checkbox) is checked:

              $group = [
                  $mform->createElement('advcheckbox', 'commnewsnewemail', 'Email', ''),
                  $mform->createElement('text', 'commnewsemail', get_string('email'))
              ];
              $mform->addElement('group', 'commnewsgroup', 'Receive communication email', $group, '', false);
              $mform->hideIf('commnewsemail', 'commnewsnewemail', 'notchecked');
              $mform->setType('commnewsemail', PARAM_EMAIL);
      

      This works perfectly in Boost but in Clean the whole group is hidden.
      Copy attached file test60205.php to your wwwroot and open in the browser to test

        Attachments

          Issue Links

            Activity

              People

              • Votes:
                0 Vote for this issue
                Watchers:
                4 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:
                  Fix Release Date:
                  13/Nov/17