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

Award criteria for ALL cohort - WHERE clause broken

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Open
    • Priority: Minor
    • Resolution: Unresolved
    • Affects Version/s: 3.5.12, 3.6.10, 3.7.6, 3.8.3, 3.9
    • Fix Version/s: None
    • Component/s: Badges

      Description

      The code to award a badge when the criteria requires being a member of multiple cohorts is broken.

      It appears that the WHERE clause that's generated when seeing if a person is a member of ALL required cohorts doesn't work.

      In criteria/award_criteria_cohort line 247ish reads:

      $where = ' AND cm.cohortid = :cohortid'.$i;

      When I believe it should read:

      $where .= ' AND cm.cohortid = :cohortid'.$i;

      So a person could gain the badge if they were only a member of the last cohort, not all cohorts, because the AND clause only includes the last cohortid.

      I was looking at MDL-63120 and ran across this line, which I'm pretty sure is just a simple oversight bug, but I'm definitely not a) a php programmer or b) overly familiar with the cohort award code.

        Attachments

          Activity

            People

            Assignee:
            Unassigned
            Reporter:
            martygilbert Marty Gilbert
            Participants:
            Component watchers:
            Yuliya Bozhko, Amaia Anabitarte, Carlos Escobedo, Ferran Recio, Sara Arjona (@sarjona), Víctor Déniz Falcón
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Dates

              Created:
              Updated: