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

Invalid response in mod_assign_get_submission_status WS

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 3.2.2
    • Fix Version/s: 3.1.6, 3.2.3
    • Component/s: Assignment
    • Labels:
    • Testing Instructions:
      Hide
      1. Create an assignment allow just an online text submission (no attachments/files)
      2. As student, submit the assignment
      3. Now, to test this you need to modify this file: mod/assign/submission/onlinetext/locallib.php
      4. Change this line: return array('onlinetext' => get_string('pluginname', 'assignsubmission_onlinetext'));
      5. With: return array('onlinetext' => 'some <br> html <b>here</b>');
      6. As admin, enable "Mobile services": Site administration ► Mobile app ► Mobile settings
      7. Now, with the mobile app. Access to the assignment via the Mobile app, and check that you can see correctly the submission you did (date and text submitted).
      Show
      Create an assignment allow just an online text submission (no attachments/files) As student, submit the assignment Now, to test this you need to modify this file: mod/assign/submission/onlinetext/locallib.php Change this line: return array('onlinetext' => get_string('pluginname', 'assignsubmission_onlinetext')); With: return array('onlinetext' => 'some <br> html <b>here</b>'); As admin, enable "Mobile services": Site administration ► Mobile app ► Mobile settings Now, with the mobile app. Access to the assignment via the Mobile app, and check that you can see correctly the submission you did (date and text submitted).
    • Affected Branches:
      MOODLE_32_STABLE
    • Fixed Branches:
      MOODLE_31_STABLE, MOODLE_32_STABLE
    • Pull from Repository:
    • Pull Master Branch:
      MDL-58707-master

      Description

      This is the invalid response:

      lastattempt => Invalid response value detected: submission => Invalid response value detected: plugins => Invalid response value detected: editorfields => Invalid response value detected: description => Invalid response value detected: Invalid external api response: the value is \"<br \/>\", the server was expecting \"text\" type

      This is happening when there are plugins installed that are returning the editor field description including HTML. The param is set to PARAM_TEXT so the WS response fails.

      Example of get_editor_fields, as we can see is returning a description using get_string (that means that it may content html):

          public function get_editor_fields() {
              return array('onlinetext' => get_string('pluginname', 'assignsubmission_comments'));
          }
      

        Attachments

          Activity

            People

            • Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:
                Fix Release Date:
                8/May/17