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

Messaging breaks when "Personal messages between users" is disabled.

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Open
    • Priority: Minor
    • Resolution: Unresolved
    • Affects Version/s: 3.7.4, 3.8.1, 3.9
    • Fix Version/s: None
    • Component/s: Messages
    • Labels:
    • Testing Instructions:
      Hide

      1.  Log in as an admin and at Site Settings > Messaging > Notification Settings, set "Personal messages between users"  to disabled. 
      2.  To test the fix
          a. Open an user's profile page and click the message icon next to the name.
          b. Send a message to the user.
          c. There is no error.

      Show
      1.  Log in as an admin and at Site Settings > Messaging > Notification Settings, set "Personal messages between users"  to disabled.  2.  To test the fix     a. Open an user's profile page and click the message icon next to the name.     b. Send a message to the user.     c. There is no error.
    • Affected Branches:
      MOODLE_37_STABLE, MOODLE_38_STABLE, MOODLE_39_STABLE
    • Pull from Repository:
    • Pull Master Branch:
      MDL-68070-master_messaging_fix

      Description

      Description

      When "Personal messages between users" is disabled, attempting to send a message to a user results in the error messages:

      "timestamps => Invalid parameter value detected (timestamp => Invalid parameter value detected (Invalid external api parameter: the value is "NaN", the server was expecting "int" type): Invalid external api parameter: the value is "NaN", the server was expecting "int" type): timestamp => Invalid parameter value detected (Invalid external api parameter: the value is "NaN", the server was expecting "int" type): Invalid external api parameter: the value is "NaN", the server was expecting "int" type
      Error code: invalidparameter"

       

      AND

       

      Type Error
       
      message.userfrom is undefined
       

      Steps to replicate:

       

      As Admin, open the message settings

      http://tbc.test/admin/message.php

      Uncheck "Personal messages between users" in the "enabled" column.

      Save changes

      Open a user's profile page and click the message icon next to their name

      Try sending a message to the user

      Expected:

      Message sent

      Actual:

      See error messages already described.

       

      Suggested solution:

      In messagelib.php there is a function called "message_send".

      This function returns false if "personal messages between users" is set to disabled.

      This causes problems for the core_message_send_instant_messages which continues to send the response fields you would normally expect except that the id is null and the timecreated fields isn't a number.

      The webservice should throw an error to say that personal messages are disabled between users.

      A second improvement would be to modify the user interface so that it isn't possible to send messages when the "personal messages between uesrs" setting is disabled.

        Attachments

          Activity

            People

            Assignee:
            Unassigned
            Reporter:
            brudinie guy thomas
            Participants:
            Component watchers:
            Amaia Anabitarte, Carlos Escobedo, Ferran Recio, Sara Arjona (@sarjona), Víctor Déniz Falcón
            Votes:
            24 Vote for this issue
            Watchers:
            21 Start watching this issue

              Dates

              Created:
              Updated: