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

tag/lib.php todo: Update tag cleanup sql so that it supports multiple types of tags

XMLWordPrintable

    • Icon: Improvement Improvement
    • Resolution: Deferred
    • Icon: Minor Minor
    • None
    • 2.2
    • Tags

      This issue is creating an associated MDL for an orphan TODO in tag/lib.php, which I came across while working on [MDL-30992]...

      tag/lib.php

          // TODO MDL-31212 this will only clean tags of type 'default'.  This is good as
          // it won't delete 'official' tags, but the day we get more than two
          // types, we need to fix this.
          $unused_tags = $DB->get_recordset_sql("SELECT tg.id
                                                   FROM {tag} tg
                                                  WHERE tg.tagtype = 'default'
                                                        AND NOT EXISTS (
                                                            SELECT 'x'
                                                              FROM {tag_instance} ti
                                                             WHERE ti.tagid = tg.id
                                                        )");

      The above code is an extract from the tag_cleanup() function in tag/lib.php. It suggests we update the SQL here to support multiple types of tags, as soon as the need arises in the future. However for a superficial view of this issue, it appears to me that changing the appropriate section of the WHERE to the following, would address this issue:
      WHERE tg.tagtype <> 'official'

      The code was last touched by scyrma (Mathieu)

            Unassigned Unassigned
            gerry Gerard Caulfield
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved:

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