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

Missing require for filelib in message_output_airnotifier

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 2.7.1
    • Fix Version/s: 2.7.3
    • Component/s: Messages
    • Labels:
    • Testing Instructions:
      Hide
      1. Configure and enable the "Mobile notifications" message output, you can find and access key in the comments bellow (comment restricted)
      2. Once configured (you only need to add the access key), remember to enable the plugin.
      3. Log in with an student account, go to your messaging preferences and enable receive Mobile notifications for internal messages
      4. Enable "Mobile services": Plugins ► Web Services ► External services
      5. Create a Token for the same student you used above:
      6. Click on Site administration ► Plugins ► Web services ► Manage tokens
      7. Click add, select user and service (Mobile Service)
      8. Next, you can do a CURL REST call simulating a WS client:
        • You need to replace the touserid value (3) to another user id in the same course of the user id you created the token.
        • You also need to replace the wstoken and the URL of your moodle instance

          curl 'http://localhost/m/stable_27/webservice/rest/server.php?moodlewsrestformat=json' -H 'Pragma: no-cache' -H 'Origin: file://' -H 'Accept-Encoding: gzip,deflate,sdch' -H 'Accept-Language: es,en;q=0.8,de-DE;q=0.6,de;q=0.4' -H 'User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_9_4) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/34.0.1798.0 Safari/537.36' -H 'Content-Type: application/x-www-form-urlencoded; charset=UTF-8' -H 'Accept: application/json, text/javascript, */*; q=0.01' -H 'Cache-Control: no-cache' -H 'Connection: keep-alive' --data 'messages%5B0%5D%5Btouserid%5D=3&messages%5B0%5D%5Btext%5D=new+message+test&messages%5B0%5D%5Btextformat%5D=1&wsfunction=moodle_message_send_instantmessages&wstoken=a94d048ece53cd8284c35af81eebee72' --compressed
          

      9. Confirm that:
        • The result of that curl call should look similar to:

          [{"msgid":x}] (x is a number)
          

      Show
      Configure and enable the "Mobile notifications" message output, you can find and access key in the comments bellow (comment restricted) Once configured (you only need to add the access key), remember to enable the plugin. Log in with an student account, go to your messaging preferences and enable receive Mobile notifications for internal messages Enable "Mobile services": Plugins ► Web Services ► External services Create a Token for the same student you used above: Click on Site administration ► Plugins ► Web services ► Manage tokens Click add, select user and service (Mobile Service) Next, you can do a CURL REST call simulating a WS client: You need to replace the touserid value (3) to another user id in the same course of the user id you created the token. You also need to replace the wstoken and the URL of your moodle instance curl 'http://localhost/m/stable_27/webservice/rest/server.php?moodlewsrestformat=json' -H 'Pragma: no-cache' -H 'Origin: file://' -H 'Accept-Encoding: gzip,deflate,sdch' -H 'Accept-Language: es,en;q=0.8,de-DE;q=0.6,de;q=0.4' -H 'User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_9_4) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/34.0.1798.0 Safari/537.36' -H 'Content-Type: application/x-www-form-urlencoded; charset=UTF-8' -H 'Accept: application/json, text/javascript, */*; q=0.01' -H 'Cache-Control: no-cache' -H 'Connection: keep-alive' --data 'messages%5B0%5D%5Btouserid%5D=3&messages%5B0%5D%5Btext%5D=new+message+test&messages%5B0%5D%5Btextformat%5D=1&wsfunction=moodle_message_send_instantmessages&wstoken=a94d048ece53cd8284c35af81eebee72' --compressed Confirm that: The result of that curl call should look similar to: [{"msgid":x}] (x is a number)
    • Affected Branches:
      MOODLE_27_STABLE
    • Fixed Branches:
      MOODLE_27_STABLE
    • Pull from Repository:
    • Pull Master Branch:

      Description

      This was originally reported in the github repo:

      The issue is when I send a private message to a course participant via mobile app (MM) service moodle_message_send_instantmessages, I receive the error message below in Moodle Mobile.

      "Cannot connect: Verify that your have typed correctly the URL and that your site uses Moodle 2.4 or later."

      while on server I can see the Apache (PHP) error log below.

      PHP Fatal error: Class 'curl' not found in /my_moodle_path/moodle/message/output/airnotifier/message_output_airnotifier.php on line 110

      Note: The error occurs only when I send a private message through Mobile App service. However if I send a private message directly from the Moodle Web interface, it works fine without any error message.

        Attachments

          Activity

            People

            Assignee:
            jleyva Juan Leyva
            Reporter:
            jleyva Juan Leyva
            Peer reviewer:
            Ankit Agarwal
            Integrator:
            Dan Poltawski
            Tester:
            Andrew Nicols
            Participants:
            Component watchers:
            Amaia Anabitarte, Carlos Escobedo, Ferran Recio, Sara Arjona (@sarjona)
            Votes:
            1 Vote for this issue
            Watchers:
            4 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved:
              Fix Release Date:
              10/Nov/14