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

Forms: Invalid HTML with duplicate id fgroup_id_buttonar

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Not a bug
    • Icon: Minor Minor
    • None
    • 3.7.2
    • Forms Library
    • MOODLE_37_STABLE
    • MDL-67104-master
    • Hide
      1. Go to any forum.
      2. Edit settings (using the cogwheel icon).
      3. View page source.
      4. In the source code, search for fgroup_id_buttonar
        • EXPECTED: Although this may occur multiple times, for example as a for= attribute, only one of them is id="fgroup_id_buttonar".
      5. Back in the web page, expand Availability and turn on both the due date and cutoff date. Set the cutoff date earlier than the due date.
      6. Save the form.
        • EXPECTED: There is a validation error, which displays under the two dates.

      (Note: Second part of the test is just to check that the validation error display is still working after this change.)

      Show
      Go to any forum. Edit settings (using the cogwheel icon). View page source. In the source code, search for fgroup_id_buttonar EXPECTED: Although this may occur multiple times, for example as a for= attribute, only one of them is id="fgroup_id_buttonar" . Back in the web page, expand Availability and turn on both the due date and cutoff date. Set the cutoff date earlier than the due date. Save the form. EXPECTED: There is a validation error, which displays under the two dates. (Note: Second part of the test is just to check that the validation error display is still working after this change.)

      Go to a Moodle site and edit a forum (it doesn't really have to be a forum - could be almost any other kind of form). For example, here's one on school demo (log in as manager):

      https://school.moodledemo.net/course/modedit.php?update=49&return=1

      View source on this page and search for fgroup_id_buttonar.

      Note that there are 2 different elements with this as their id. It is not valid HTML to have two elements with the same ID.

      <div id="fgroup_id_buttonar" class="form-group row  fitem femptylabel  " data-groupname="buttonar">
      

      and

      <div class="form-control-feedback invalid-feedback" id="fgroup_id_buttonar" >
      

      These are created by a form element template element-template.mustache from two different variables but I guess element.iderror must in this case be the same as element.wrapperid.

            Unassigned Unassigned
            quen Sam Marshall
            Mihail Geshoski Mihail Geshoski
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved:

                Estimated:
                Original Estimate - Not Specified
                Not Specified
                Remaining:
                Remaining Estimate - 0 minutes
                0m
                Logged:
                Time Spent - 10 minutes
                10m

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