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

This page did not call $PAGE->set_url(...) Using https://xxx.xxx.org/webservice/rest/server.php?moodlewsrestformat=json

    XMLWordPrintable

    Details

    • Testing Instructions:
      Hide

      To test, you need access to the PHP error log (ensure that new error logs are added e.g. add an \Exception in config.php so something like that)

      • Through WS (via curl)
        1. Create a course with an assignment activity.
        2. Enroll a student.
        3. As an admin, enable "Mobile services": Plugins ► Web Services ► Mobile
        4. Create a Token for the student:
          • Click on Site administration ► Plugins ► Web services ► Manage tokens
        5. Next, you can do a CURL REST:
          • You need to replace the WSTOKEN, ASSIGN_INSTANCE_ID and the URL of your Moodle instance (MOODLE_INSTANCE).
          • curl 'http://MOODLE_INSTANCE/webservice/rest/server.php?moodlewsrestformat=json' --data 'assignid=ASSIGN_INSTANCE_ID&wsfunction=mod_assign_get_submission_status&wstoken=WSTOKEN' | python -m "json.tool"

        6. Ensure you don't see in error_log a message like:

          Got error 'PHP message: Debugging: This page did not call $PAGE->set_url(...). Using http://moodlehq.local/webservice/rest/server.php?moodlewsrestformat=json in
          * line 600 of /lib/pagelib.php: call to debugging()
          * line 820 of /lib/pagelib.php: call to moodle_page->magic_get_url()
          * line 249 of /mod/assign/locallib.php: call to moodle_page->__get()
          * line 5011 of /mod/assign/locallib.php: call to assign->get_return_action()
          * line 2348 of /mod/assign/externallib.php: call to assign->get_assign_submission_status_renderable()
          * line 1397 of /webservice/lib.php: call to mod_assign_external::get_submission_status()
          * line 1261 of /webservice/lib.php: call to webservice_base_server->execute()
          * line 44 of /webservice/rest/server.php: call to webservice_base_server->run()

       

      Show
      To test, you need access to the PHP error log (ensure that new error logs are added e.g. add an \Exception in config.php so something like that) Through WS (via curl) Create a course with an assignment activity. Enroll a student. As an admin, enable "Mobile services": Plugins ► Web Services ► Mobile Create a Token for the student: Click on Site administration ► Plugins ► Web services ► Manage tokens Next, you can do a CURL REST: You need to replace the WSTOKEN, ASSIGN_INSTANCE_ID and the URL of your Moodle instance (MOODLE_INSTANCE). curl 'http://MOODLE_INSTANCE/webservice/rest/server.php?moodlewsrestformat=json' --data 'assignid=ASSIGN_INSTANCE_ID&wsfunction=mod_assign_get_submission_status&wstoken=WSTOKEN' | python -m "json.tool" Ensure you don't see in error_log a message like: Got error 'PHP message: Debugging: This page did not call $PAGE->set_url(...). Using http://moodlehq.local/webservice/rest/server.php?moodlewsrestformat=json in * line 600 of /lib/pagelib.php: call to debugging() * line 820 of /lib/pagelib.php: call to moodle_page->magic_get_url() * line 249 of /mod/assign/locallib.php: call to moodle_page->__get() * line 5011 of /mod/assign/locallib.php: call to assign->get_return_action() * line 2348 of /mod/assign/externallib.php: call to assign->get_assign_submission_status_renderable() * line 1397 of /webservice/lib.php: call to mod_assign_external::get_submission_status() * line 1261 of /webservice/lib.php: call to webservice_base_server->execute() * line 44 of /webservice/rest/server.php: call to webservice_base_server->run()  
    • Difficulty:
      Easy
    • Affected Branches:
      MOODLE_31_STABLE, MOODLE_34_STABLE
    • Fixed Branches:
      MOODLE_34_STABLE, MOODLE_35_STABLE
    • Pull 3.4 Branch:
    • Pull 3.5 Branch:
    • Pull Master Branch:
      MDL-55993-master

      Description

      Found while going through my php error logs (while the site debugging was set to developer)

      php[6240]
      Debugging: This page did not call $PAGE->set_url(...). Using https://xxx.xxx.org/webservice/rest/server.php?moodlewsrestformat=json in

      • line 565 of \lib\pagelib.php: call to debugging()
      • line 773 of \lib\pagelib.php: call to moodle_page->magic_get_url()
      • line 259 of \mod\assign\locallib.php: call to moodle_page->__get()
      • line 4432 of \mod\assign\locallib.php: call to assign->get_return_params()
      • line 2408 of \mod\assign\externallib.php: call to assign->get_assign_submission_status_renderable()
      • line ? of unknownfile: call to mod_assign_external::get_submission_status()
      • line 1326 of \webservice\lib.php: call to call_user_func_array()
      • line 1190 of \webservice\lib.php: call to webservice_base_server->execute()
      • line 44 of \webservice\rest\server.php: call to webservice_base_server->run()

        Attachments

          Issue Links

            Activity

              People

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

                Dates

                • Created:
                  Updated:
                  Resolved:
                  Fix Release Date:
                  10/Sep/18