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

Forms: Invalid HTML with duplicate id fgroup_id_buttonar

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor
    • Resolution: Not a bug
    • Affects Version/s: 3.7.2
    • Fix Version/s: None
    • Component/s: Forms Library
    • Labels:
    • Testing Instructions:
      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.)
    • Affected Branches:
      MOODLE_37_STABLE
    • Pull 3.7 Branch:
      MDL-67104-m37
    • Pull Master Branch:
      MDL-67104-master

      Description

      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.

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              Unassigned
              Reporter:
              quen Sam Marshall
              Peer reviewer:
              Mihail Geshoski
              Participants:
              Component watchers:
              Adrian Greeve, Jake Dallimore, Mathew May, Mihail Geshoski, Peter Dias
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:

                  Time Tracking

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