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

Invalid response value detected: content3 in mod_data_get_entries

    XMLWordPrintable

    Details

    • Testing Instructions:
      Hide
      1. Create a course with a database using the image gallery preset
      2. Enrol a couple of users as teacher and student in that course
      3. As the student or teacher add a couple of entries to the database
      4. Then go to the Moodle database (not the module, I mean the mysql or postgres) and edit any of the records of the "data_content" table related to your database created at step 1. You must add something (any text) to the content3 and content4 fields
      5. Enable "Mobile services": Site administration ► Mobile app ► Mobile settings
      6. Create a Token in the mobile app service for the student in the course:
        • Click on Site administration ► Plugins ► Web services ► Manage tokens
      7. Next, you can do a CURL REST call simulating a WS client with the student.
        • You need to replace the wstoken, databaseid (database instance id) and the URL of your moodle instance

          curl 'http://localhost/m/stable_master/webservice/rest/server.php?moodlewsrestformat=json' --data 'databaseid=8&wsfunction=mod_data_get_entries&wstoken=12a2a65aeea2a177055e233f9e303218&moodlewssettingfilter=true' | python -m "json.tool"

      8. Now check that the WS works and returns the database entries you created.
      Show
      Create a course with a database using the image gallery preset Enrol a couple of users as teacher and student in that course As the student or teacher add a couple of entries to the database Then go to the Moodle database (not the module, I mean the mysql or postgres) and edit any of the records of the "data_content" table related to your database created at step 1. You must add something (any text) to the content3 and content4 fields Enable "Mobile services": Site administration ► Mobile app ► Mobile settings Create a Token in the mobile app service for the student in the course: Click on Site administration ► Plugins ► Web services ► Manage tokens Next, you can do a CURL REST call simulating a WS client with the student. You need to replace the wstoken, databaseid (database instance id) and the URL of your moodle instance curl 'http://localhost/m/stable_master/webservice/rest/server.php?moodlewsrestformat=json' --data 'databaseid=8&wsfunction=mod_data_get_entries&wstoken=12a2a65aeea2a177055e233f9e303218&moodlewssettingfilter=true' | python -m "json.tool" Now check that the WS works and returns the database entries you created.
    • Affected Branches:
      MOODLE_33_STABLE
    • Fixed Branches:
      MOODLE_33_STABLE
    • Pull from Repository:
    • Pull Master Branch:
      MDL-59649-master

      Description

      When testing a database using the content3 field to store data:

      {"exception":"invalid_response_exception","errorcode":"invalidresponse","message":"Invalid response value detected","debuginfo":"entries => Invalid response value detected: contents => Invalid response value detected: content3 => Invalid response value detected: Invalid external api response: the value is \"\", the server was expecting \"bool\" type"}

      This seems to happen only in databases imported or updated from Moodle 1.x (new versions seems to not use content3 or content4), or maybe using a field plugin.

        Attachments

          Activity

            People

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

              Dates

              • Created:
                Updated:
                Resolved:
                Fix Release Date:
                11/Sep/17