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

    • MOODLE_34_STABLE
    • MOODLE_34_STABLE
    • MDL-60205_group_hiding_clean
    • 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

      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

            davosmith Davo Smith
            marina Marina Glancy
            Marina Glancy Marina Glancy
            Jun Pataleta Jun Pataleta
            Adrian Greeve Adrian Greeve
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved:

                Error rendering 'clockify-timesheets-time-tracking-reports:timer-sidebar'. Please contact your Jira administrators.