-
Improvement
-
Resolution: Deferred
-
Minor
-
None
-
2.2
-
MOODLE_22_STABLE
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)