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

tool_cohortroles error when any cohort has a null idnumber

    XMLWordPrintable

    Details

    • Testing Instructions:
      Hide

      Create a cohort with a null value in the idnumber field. (you may need to do this at the db level)
      On the tool_cohortroles page, enter a search value in the "select cohorts" field that will include the cohort with the null idnumber field.
      Make sure the list of cohorts that match the search are shown and the error described does not appear.

      Show
      Create a cohort with a null value in the idnumber field. (you may need to do this at the db level) On the tool_cohortroles page, enter a search value in the "select cohorts" field that will include the cohort with the null idnumber field. Make sure the list of cohorts that match the search are shown and the error described does not appear.
    • Affected Branches:
      MOODLE_31_STABLE
    • Fixed Branches:
      MOODLE_31_STABLE
    • Pull Master Branch:
      master_MDL-56358

      Description

      typically when cohorts are created using the UI we end up with an empty string in the idnumber field. But if another method is used and any cohort has a Null value in the idnumber field, the select cohorts ajax search fails and no cohorts can be selected.

      Invalid response value detected
      File: .../lib/externallib.php Line: 424
      Stack trace:
      cohorts => Invalid response value detected: idnumber => Invalid response value detected: Invalid external api response: the value is "", the server was expecting "raw" typeError code: invalidresponse

      the core function cohort_add_cohort() uses "NULL" as the idnumber if it is not passed in the initial parameter.

        Attachments

          Activity

            People

            • Assignee:
              danmarsden Dan Marsden
              Reporter:
              danmarsden Dan Marsden
              Peer reviewer:
              Mark Nelson
              Integrator:
              David Monllaó
              Tester:
              Frédéric Massart
              Participants:
              Component watchers:
              Damyon Wiese, Jean-Philippe Gaudreau, Steve Massicotte, Serge Gauthier, Issam Taboubi, Adrian Greeve, Mihail Geshoski, Peter Dias, Juan Leyva, Jake Dallimore, Jun Pataleta
            • Votes:
              1 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:
                Fix Release Date:
                9/Jan/17