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

tag/lib.php todo: Amend code to work with the new Moodle 2.0 tag_instance table structure

    XMLWordPrintable

    Details

    • Type: Improvement
    • Status: Reopened
    • Priority: Minor
    • Resolution: Unresolved
    • Affects Version/s: 2.2
    • Fix Version/s: None
    • Component/s: Tags
    • Labels:

      Description

      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

      if ( array_key_exists($tag->ordering, $tag_ids) ) {
          // until we can add a unique constraint, in table tag_instance,
          // on (itemtype, itemid, ordering), this is needed to prevent a bug
          // TODO : modify database in 2.0
          $tag->ordering++;
      }

      The above code is an extract from the tag_get_tags_ids() function in tag/lib.php. Having a quick look at the tag_instance instance table it appears that there is still no unique id on itemtype, itemid and ordering, so this will need to be added before this todo can be resolved. However I did not write the TODO and it does not say what bug it is trying to prevent. It was last touched by scyrma, who I'm sure would have a much better idea of what needs to be done.

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                Unassigned
                Reporter:
                gerry Gerard Caulfield
                Participants:
                Component watchers:
                Amaia Anabitarte, Carlos Escobedo, Ferran Recio, Sara Arjona (@sarjona), Víctor Déniz Falcón
              • Votes:
                0 Vote for this issue
                Watchers:
                1 Start watching this issue

                Dates

                • Created:
                  Updated: