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

get_conversations get_in_or_equal with NOT

    XMLWordPrintable

Details

    • Bug
    • Status: Closed
    • Blocker
    • Resolution: Fixed
    • 3.6
    • 3.6
    • Messages

    Description

                      list ($insql, $inparams) = $DB->get_in_or_equal($favouriteconversationids, SQL_PARAMS_NAMED, 'favouriteids');
                      $favouritesql = $favourites ? " AND mc.id {$insql} " : " AND mc.id NOT {$insql} ";
      

      You should not use the "NOT" - please use the extra argument to get_in_or_equal.
      The get_in_or_equal function will return "= ?" or "<> ?" if there is only one array key. Your SQL will then become:

      AND mc.id NOT = ?
      

      Attachments

        Issue Links

          Activity

            People

              dobedobedoh Andrew Lyons
              dobedobedoh Andrew Lyons
              Jake Dallimore Jake Dallimore
              David Monllaó David Monllaó
              CiBoT CiBoT
              Amaia Anabitarte, Carlos Escobedo, Ferran Recio, Ilya Tregubov, Sara Arjona (@sarjona)
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:
                3/Dec/18