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

E_WARNING in core_webservice_get_site_info

    XMLWordPrintable

Details

    • Bug
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • 2.7.10, 2.8.8, 2.9.2
    • 2.8.9, 2.9.3
    • Web Services
    • MOODLE_27_STABLE, MOODLE_28_STABLE, MOODLE_29_STABLE
    • MOODLE_28_STABLE, MOODLE_29_STABLE
    • Hide

      Before this test you must ensure that PHP will log E_WARNINGs for Moodle.

      You will also want to create a web service token for a user on the Moodle Mobile web service in Site administration > Plugins > Web services > Manage tokens

      1. Execute the core_webservice_get_site_info via: <your moodle url>/webservice/rest/server.php?moodlewsrestformat=xml&wstoken=<web service token>&wsfunction=core_webservice_get_site_info
      2. Examine your PHP error log, you should not see a 'Creating default object from empty value' Warning for the rest web service page.
      Show
      Before this test you must ensure that PHP will log E_WARNINGs for Moodle. You will also want to create a web service token for a user on the Moodle Mobile web service in Site administration > Plugins > Web services > Manage tokens Execute the core_webservice_get_site_info via: <your moodle url> /webservice/rest/server.php?moodlewsrestformat=xml&wstoken= <web service token> &wsfunction=core_webservice_get_site_info Examine your PHP error log, you should not see a 'Creating default object from empty value' Warning for the rest web service page.

    Description

      E_WARNING: Creating default object from empty value

      Stack trace
      in unknown called at /var/www/html/mod/assign/version.php (27)
      in include called at /var/www/html/webservice/externallib.php (142)
      in core_webservice_external::get_site_info called at ?
      in call_user_func_array called at /var/www/html/webservice/lib.php (1780)
      in webservice_base_server::execute called at /var/www/html/webservice/lib.php (1644)
      …webservice_base_server::run called at /var/www/html/webservice/rest/
      server.php (44)

      Reproducible steps

      Pre-requisites

      1. A user configured to use an external web service that includes core_webservice_get_site_info, for example Moodle Mobile sevices
      2. You have a web service token for the user.
      3. Moodle and PHP are set to log Warnings

      Steps

      1. Load the webservice via <your moodle url>/webservice/rest/server.php?moodlewsrestformat=xml&wstoken=<web service token>&wsfunction=core_webservice_get_site_info
      2. Examine your PHP error log
      3. You should see an warning about Creating default object from empty value

      Attachments

        Activity

          People

            nmagill Neill Magill
            nmagill Neill Magill
            Ryan Wyllie Ryan Wyllie
            Dan Poltawski Dan Poltawski
            Dan Poltawski Dan Poltawski
            Juan Leyva, David Woloszyn, Huong Nguyen, Jake Dallimore, Meirza, Michael Hawkins, Raquel Ortega, Safat Shahin, Stevani Andolo
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:
              9/Nov/15