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

Clean up get_sql_sort in tablelib

    XMLWordPrintable

Details

    • Improvement
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • 2.0
    • 2.0
    • Libraries
    • None
    • MOODLE_20_STABLE
    • MOODLE_20_STABLE

    Description

      At the moment, flexible_table::get_sql_sort can either be called as an instance method, or as a static method, but that last option is only used in one place in the assignment module.

      Also, it does several things in one place, namely getting the list of sort columns, and then building the SQL from them. In the quiz report, we have some code that wants a list of columns, so it does get_sql_sort, and then explodes it. That is a bit silly. It would be better to have a separate method to get the list of columns as an array.

      So, I am going to do a bit of refactoring to split this into separate methods. And change assignment, so the static method can be separate from the instance method.

      Attachments

        Activity

          People

            timhunt Tim Hunt
            timhunt Tim Hunt
            Nobody Nobody
            Amaia Anabitarte, Carlos Escobedo, Ferran Recio, Ilya Tregubov, Sara Arjona (@sarjona)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:
              24/Nov/10