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

Unclosed HTML structure in the Database activity entry list view

      In the mod_data module (Database activity), the output generated when listing entries (list view) does not properly close some <div> tags. As a result, the HTML structure ends up malformed, placing the <footer> element inside the #topofscroll container. This affects the layout in themes where the footer is expected to be rendered at full page width (e.g., on moodle.org), although it may not be visually noticeable in standard Moodle themes.

      This issue likely stems from the data_print_preference_form() function, which outputs the filtering and sorting form at the top of the list view. It opens several <div> containers but fails to close them properly, leaving the HTML hierarchy broken.

      Steps to reproduce:

      1. Enable Performance Info under Site administration > Development > Debugging.
      1. Create a new course.
      2. Add a Database activity.
      3. Add several entries to the database.
      4. Go to the List view of the activity.
      5. Observe the HTML structure using browser developer tools or by viewing page source.

      In a correct scenario (e.g., when viewing a single entry), the DOM should look like this:

      <div id="page"> <div id="topofscroll"></div> <footer>...</footer></div>
      However, in the list view, it becomes:
       
      <div id="page"> <div id="topofscroll"> <footer>...</footer> </div></div>

      Impact:

      • Breaks layout in themes with fixed or full-width footers.
      • Affects readability and rendering on moodle.org and similar custom setups.
      • Could lead to unexpected behavior with CSS or JavaScript targeting these containers.

        1. image-2025-05-09-19-34-38-832.png
          8 kB
          Rajneel Totaram
        2. image-2025-05-09-19-38-24-080.png
          14 kB
          Rajneel Totaram

            daniel.urena@moodle.com Daniel Ureña
            daniel.urena@moodle.com Daniel Ureña
            Rajneel Totaram Rajneel Totaram
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated:

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