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

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

    XMLWordPrintable

Details

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

    Description

      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

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              stronk7 Eloy Lafuente (stronk7)
              Yuliya Bozhko, Amaia Anabitarte, Bas Brands, Carlos Escobedo, Laurent David, Sabina Abellan, Sara Arjona (@sarjona)
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: