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

Warning messages in Apache error log from mod_forum_external::view_forum()

    XMLWordPrintable

    Details

    • Testing Instructions:
      Hide
      Setup
      1. Make sure debugging is on.
        • Site administration ► Development ► Debugging – Set Debug messages to DEVELOPER. Alternatively, if using MDK, type in mdk run dev.
      2. Create a course with a standard forum. Take note of the forum's identifier
      3. Enrol some students.
      4. On the Moodle instance, enable mobile web services in Site administration ► Plugins ► Web services ► Mobile.
      5. Create a web service token for a user in Site administration ► Plugins ► Web services ► Manage tokens
      6. Open a terminal and tail your web server's error log. For example:

        tail -f /var/log/apache2/error.log
        

      Testing
      1. Open another terminal window, type in the following curl command:

        curl 'http://[YOUR_MOODLE_URL]/webservice/rest/server.php?moodlewsrestformat=json' --data 'forumid=[THE_FORUM_ID]&wsfunction=mod_forum_view_forum&wstoken=[YOUR_TOKEN_HERE]' | python -m "json.tool"

      2. Check the output for Apache's error log.
        • Confirm that there are no debug warning messages shown after the entering the curl command.
      Show
      Setup Make sure debugging is on. Site administration ► Development ► Debugging – Set Debug messages to DEVELOPER. Alternatively, if using MDK, type in mdk run dev . Create a course with a standard forum. Take note of the forum's identifier Enrol some students. On the Moodle instance, enable mobile web services in Site administration ► Plugins ► Web services ► Mobile . Create a web service token for a user in Site administration ► Plugins ► Web services ► Manage tokens Open a terminal and tail your web server's error log. For example: tail -f /var/log/apache2/error.log Testing Open another terminal window, type in the following curl command: curl 'http://[YOUR_MOODLE_URL]/webservice/rest/server.php?moodlewsrestformat=json' --data 'forumid=[THE_FORUM_ID]&wsfunction=mod_forum_view_forum&wstoken=[YOUR_TOKEN_HERE]' | python -m "json.tool" Check the output for Apache's error log. Confirm that there are no debug warning messages shown after the entering the curl command.
    • Affected Branches:
      MOODLE_30_STABLE, MOODLE_31_STABLE
    • Fixed Branches:
      MOODLE_30_STABLE, MOODLE_31_STABLE
    • Pull Master Branch:
      MDL-55112-master

      Description

      To reproduce:

      Server side
      1. Make sure debugging is on.
        • Site administration ► Development ► Debugging – Set Debug messages to DEVELOPER. Alternatively, if using MDK, type in mdk run dev.
      2. Create a course C1 with a forum F1.
      3. Optionally, create a discussion within the forum.
      4. Enrol some students.
      5. On the Moodle instance, enable mobile web services in Site administration ► Plugins ► Web services ► Mobile.
      6. Open a terminal and tail your web server's error log. For example:

        tail -f /var/log/apache2/error.log
        

      Mobile
      1. Download and install the Moodle mobile app.
      2. Configure the mobile app for the Moodle instance and log in as a student.
      3. Navigate to the course C1.
      4. Navigate to the forum F1.
      5. Check the terminal output:
      6. Expected
        • There should be no warning messages.
      7. Actual
        • The following warning message are being displayed:

          Debugging: Fields list in snapshot record does not match fields list in 'forum'. Record is missing fields: course, type, name, intro, introformat, assessed, assesstimestart, assesstimefinish, scale, maxbytes, maxattachments, forcesubscribe, trackingtype, rsstype, rssarticles, timemodified, warnafter, blockafter, blockperiod, completiondiscussions, completionreplies, completionposts, displaywordcount in

          • line 876 of /lib/classes/event/base.php: call to debugging()
          • line 7807 of /mod/forum/lib.php: call to core\\event
            base->add_record_snapshot()
          • line 643 of /mod/forum/externallib.php: call to forum_view()
          • line 1327 of /webservice/lib.php: call to mod_forum_external::view_forum()
          • line 1191 of /webservice/lib.php: call to webservice_base_server->execute()
          • line 44 of /webservice/rest/server.php: call to webservice_base_server->run()

        Attachments

          Activity

            People

            Assignee:
            jpataleta Jun Pataleta
            Reporter:
            jpataleta Jun Pataleta
            Peer reviewer:
            Mark Nelson
            Integrator:
            Dan Poltawski
            Tester:
            Simey Lameze
            Participants:
            Component watchers:
            Andrew Nicols, Jun Pataleta, Michael Hawkins, Shamim Rezaie, Simey Lameze, Juan Leyva, Amaia Anabitarte, Carlos Escobedo, Ferran Recio, Sara Arjona (@sarjona), Víctor Déniz Falcón
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved:
              Fix Release Date:
              12/Sep/16