-
Improvement
-
Resolution: Won't Do
-
Minor
-
None
-
2.8.6, 2.9
-
None
-
MOODLE_28_STABLE, MOODLE_29_STABLE
This issue is a follow-up of the MDL-25138, I've noticed the Tag API needs a extensive review and re-factoring.
I've noticed few problems, but certainly there are others.
Firstly, the tag_get_related_tags method calls two other methods: tag_get_tags() and tag_get_correlated() methods which has the same problematic SQL query on both methods, returning duplicates tags. This is due mostly because of the ordering and taginstanceid columns. It's not clear what's the purpose of both columns and a review should be done to see what's the usage and if those columns can be removed. A nice solution would be a query that get all tags and deprecate useless methods.
Also, unit tests for the API must be created as an assurance.