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

Tablelib creating thousands of "emptyrow" rows...

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Won't Do
    • Icon: Minor Minor
    • None
    • 2.8.7, 2.9.1, 3.0
    • Libraries
    • MOODLE_28_STABLE, MOODLE_29_STABLE, MOODLE_30_STABLE

      Hi,

      while looking @ MDL-50919, it was detected that tablelib blindly creates a table with $perpage rows, no matter the total is smaller or any other consideration.

      So if you call to pagesize(50000, 1, it still creates a table with 49999 hidden rows.

      As a temporal fix, in the linked issue I've applied a quick fix in the caller, only for master:

      -            $this->pagesize($pagesize, $total);
      +            $this->pagesize(min($pagesize, $total), $total);
      

      As references, looking in the tracker about information justifying current/weird behavior, I've found MDL-41534, but not much else.

      So this is about to consider if we could always "optimize" the number of rows created within tablelib or that's not possible (for some unknown reason) and it's a caller responsibility to adjust it.

      Also, note that this behavior is 100% reproducible in 28 and 29 manage tags page... and in any other page using tablelib and having a big "SHOW_ALL_PAGE_SIZE" (or similar) defined.

      Ciao

            Unassigned Unassigned
            stronk7 Eloy Lafuente (stronk7)
            Votes:
            1 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved:

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