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

All 4 calls to calendar_sql_where() function are followed by identical code which should therefore be within the function

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Trivial
    • Resolution: Fixed
    • Affects Version/s: 2.0
    • Fix Version/s: 1.9, 2.0
    • Component/s: Calendar
    • Labels:
      None
    • Affected Branches:
      MOODLE_20_STABLE
    • Fixed Branches:
      MOODLE_19_STABLE, MOODLE_20_STABLE

      Description

      There are only 4 calls to the calendar_sql_where() function and each call is followed by identical code to select calendar events. This is not good practice and the accompanying patch embodies the calendar event selection within the renamed (calendar_get_events()) function, always returning an array (even if empty) of events.

      Furthermore, there are issues with regards to selecting calendar events on installations with large numbers of users, groups and/or courses which will require changes to the way events are selected anyway, so it makes sense for this code to just be in one place.

        Gliffy Diagrams

          Attachments

            Activity

            Hide
            derekw Derek Woolhead added a comment -

            Patch attached to be reviewed by Sam Marshall

            Show
            derekw Derek Woolhead added a comment - Patch attached to be reviewed by Sam Marshall
            Hide
            quen Sam Marshall added a comment -

            Looks good to me.

            Show
            quen Sam Marshall added a comment - Looks good to me.
            Hide
            dougiamas Martin Dougiamas added a comment -

            Yep, great, thanks!

            Show
            dougiamas Martin Dougiamas added a comment - Yep, great, thanks!
            Hide
            derekw Derek Woolhead added a comment -

            Patch applied to both 1.9 and 2.0 as requested

            Show
            derekw Derek Woolhead added a comment - Patch applied to both 1.9 and 2.0 as requested
            Hide
            andyjdavis Andrew Davis added a comment -

            nice work. closing.

            Show
            andyjdavis Andrew Davis added a comment - nice work. closing.

              People

              • Votes:
                0 Vote for this issue
                Watchers:
                0 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:
                  Fix Release Date:
                  3/Mar/08