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

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

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Open
    • Priority: Minor
    • Resolution: Unresolved
    • Affects Version/s: 2.7.2, 2.8
    • Fix Version/s: None
    • Component/s: Badges
    • Labels:
    • Affected Branches:
      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

              • Assignee:
                Unassigned
                Reporter:
                stronk7 Eloy Lafuente (stronk7)
                Participants:
                Component watchers:
                Yuliya Bozhko, Amaia Anabitarte, Bas Brands, Carlos Escobedo, Sara Arjona (@sarjona), Víctor Déniz Falcón
              • Votes:
                0 Vote for this issue
                Watchers:
                1 Start watching this issue

                Dates

                • Created:
                  Updated: