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

Search code does not follow coding guidelines

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor
    • Resolution: Won't Fix
    • Affects Version/s: 1.9.4
    • Fix Version/s: None
    • Component/s: Global search
    • Labels:
      None
    • Affected Branches:
      MOODLE_19_STABLE

      Description

      Please see item 11. at http://docs.moodle.org/en/Development:Coding#Database_structures

      Do not use 'AS' for table aliases in SQL. That is

      SELECT x + y AS name ... is correct.

      SELECT * FROM

      {table} AS alias ... is WRONG. it should be SELECT * FROM {table}

      alias ...

      if you don't get this right, then it breaks on at least one of our supported databases. You have this wrong throughout the serach code.

      Also, in HEAD, you are using the old get_record_sql, get_field, ... functions, which do not work any more.

        Attachments

          Activity

            People

            Assignee:
            vf Valery Fremaux
            Reporter:
            timhunt Tim Hunt
            Participants:
            Component watchers:
            Amaia Anabitarte, Carlos Escobedo, Ferran Recio, Sara Arjona (@sarjona)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved: