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

Clean code from "uid" (reserved word) aliases in badges

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Won't Do
    • Icon: Minor Minor
    • None
    • 2.7.2, 2.8
    • Badges
    • MOODLE_27_STABLE, MOODLE_28_STABLE

      Looking for a solution @ MDL-47509, it was detected that the reserved-word "uid" was also being used in badges.

      $ grep -rP '(FROM|JOIN).* uid'
      badges/criteria/award_criteria_profile.php:            $join = " LEFT JOIN {user_info_data} uid ON uid.userid = u.id AND ({$extraon})";
      badges/criteria/award_criteria_profile.php:            $join = " LEFT JOIN {user_info_data} uid ON uid.userid = u.id AND ({$extraon})";
      

      I've not verified it, neither seems to fail any unit test. But I'm 99% sure it leads to problems under Oracle.

      And there are occurrences both in 2.7 and master.

      So this is about:

      1) get rid of all those "uid" uses in badges.
      2) hopefully get some simple unit test covering some of those queries so we can ensure they are working under all DBs.

      Ciao

            Unassigned Unassigned
            stronk7 Eloy Lafuente (stronk7)
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved:

                Error rendering 'clockify-timesheets-time-tracking-reports:timer-sidebar'. Please contact your Jira administrators.