Issue Details (XML | Word | Printable)

Key: MDL-12898
Type: Sub-task Sub-task
Status: Resolved Resolved
Resolution: Fixed
Priority: Minor Minor
Assignee: Mathieu Petit-Clair
Reporter: Eloy Lafuente (stronk7)
Votes: 0
Watchers: 0
Operations

Add/Edit UI Mockup to this issue
If you were logged in you would be able to see more operations.
Moodle
MDL-13404

Correlation tags SQL is missing one condition....

Created: 10/Jan/08 04:56 AM   Updated: 22/Feb/08 07:36 PM
Component/s: Tags
Affects Version/s: 1.9, 2.0
Fix Version/s: 1.9, 2.0

Database: Any
Participants: Eloy Lafuente (stronk7) and Mathieu Petit-Clair
Security Level: None
Resolved date: 22/Feb/08
Affected Branches: MOODLE_19_STABLE, MOODLE_20_STABLE
Fixed Branches: MOODLE_19_STABLE, MOODLE_20_STABLE


 Description  « Hide
I was looking code due to MDL-12897 when, in cache_correlated_tags(), this query:

    $query = "SELECT tb.tagid , COUNT(*) nr
                FROM {$CFG->prefix}tag_instance ta
                     INNER JOIN {$CFG->prefix}tag_instance tb ON ta.itemid = tb.itemid
               WHERE ta.tagid = {$tag_id}
            GROUP BY tb.tagid
            ORDER BY nr DESC";

seems to be missing one extra condition, in order to compare only same itemtype tags (or else we'll be counting unrelated items), so this join seems necessary:

INNER JOIN {$CFG->prefix}tag_instance tb ON ta.itemid = tb.itemid AND ta.itemtype = tb.itemtype

instead of the current one.

Ciao :-)

 All   Comments   Change History   Version Control      Sort Order: Ascending order - Click to sort in descending order
Mathieu Petit-Clair made changes - 12/Feb/08 12:13 PM
Field Original Value New Value
Issue Type Bug [ 1 ] Sub-task [ 5 ]
Parent MDL-13404 [ 24825 ]
Mathieu Petit-Clair made changes - 12/Feb/08 12:13 PM
Assignee Luiz Cruz [ luiz.laydner ] Mathieu Petit-Clair [ scyrma ]
Mathieu Petit-Clair added a comment - 22/Feb/08 07:36 PM
This is now fixed.

Mathieu Petit-Clair made changes - 22/Feb/08 07:36 PM
Status Open [ 1 ] Resolved [ 5 ]
Resolution Fixed [ 1 ]