Uploaded image for project: 'Plugins'
  1. Plugins
  2. CONTRIB-4965

Another cast problem with Username

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 2.6.2
    • Fix Version/s: 2.6.3
    • Component/s: Module: Questionnaire
    • Labels:
      None
    • Affected Branches:
      MOODLE_26_STABLE
    • Fixed Branches:
      MOODLE_26_STABLE

      Description

      Create a questionnaire using visible groups. Make sure that one of the users in one of the groups submits two responses to the survey.

      Select View all responses
      With All participants selected in the group drop down, select List of responses tab - the user is listed twice, as they have submitted two reponses.
      Go back to View all responses
      Select the specific group containing that user from the drop down
      Select List of responses tab

      Error reading from database

      More information about this error

      Debug info: ERROR: operator does not exist: character varying = bigint
      LINE 4: ...name AS INT) AND GM.groupid=80019 AND R.username = GM.useri...
      ^
      HINT: No operator matches the given name and argument type(s). You might need to add explicit type casts.
      SELECT R.id AS responseid, R.submitted AS submitted, R.username, U.username AS username,
      U.id as userid , GM.userid FROM mdl_questionnaire_response R,
      mdl_user U
      , mdl_groups_members GM WHERE R.survey_id=188 AND complete = 'y' AND U.id = CAST AND GM.groupid=80019 AND R.username = GM.userid ORDER BY U.lastname, U.firstname, R.submitted DESC
      [array (
      )]
      Error code: dmlreadexception
      Stack trace:
      line 443 of /lib/dml/moodle_database.php: dml_read_exception thrown
      line 239 of /lib/dml/pgsql_native_moodle_database.php: call to moodle_database->query_end()
      line 755 of /lib/dml/pgsql_native_moodle_database.php: call to pgsql_native_moodle_database->query_end()
      line 2151 of /mod/questionnaire/questionnaire.class.php: call to pgsql_native_moodle_database->get_records_sql()
      line 723 of /mod/questionnaire/report.php: call to questionnaire->survey_results_navbar_alpha()

      The "R.username = GM.userid" part of the query needs the usual CAST handling.

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                rezeau Joseph Rézeau
                Reporter:
                jenny-gray Jenny Gray
                Participants:
                Component watchers:
                Mike Churchward
              • Votes:
                0 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:
                  Fix Release Date:
                  12/May/14