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

Stored notifications miss contexturl and contextname

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 2.9
    • Fix Version/s: 2.9.1
    • Component/s: Messages
    • Labels:
    • Testing Instructions:
      Hide
      1. Create a course with a couple of enrolled students
      2. Create a forum with subscription forced
      3. As one of the students, post in the forum
      4. Browse the moodle messages (or messages_read) table and check that the fields contexturl and contexturlname are not empty/null
      Show
      Create a course with a couple of enrolled students Create a forum with subscription forced As one of the students, post in the forum Browse the moodle messages (or messages_read) table and check that the fields contexturl and contexturlname are not empty/null
    • Affected Branches:
      MOODLE_29_STABLE
    • Fixed Branches:
      MOODLE_29_STABLE
    • Pull from Repository:
    • Pull Master Branch:
      MDL-50561-master

      Description

      This is a regression caused by MDL-48212 (see commit https://github.com/moodle/moodle/commit/9bb71899c0774528f588eaf82fe4ba34bde1511b#diff-968b624e975ad3df52446c206926d60aL778)

      The problem is that the new class message does not implement the __isset magic method, this method is required when the class uses the __get magic method for exposing private variables.

      If you try to apply the empty function over a private variable function that is not empty, the result of the empty function is going to be "true" if the class does not overload the __isset method.

      In order to reproduce this:

      • Create a forum with forced subscription
      • Post in that forum so the enrolled users receive notifications
      • Check in the messages table that the fields contexturl and contexturlname are null for that message

        Attachments

          Issue Links

            Activity

              People

              • Votes:
                0 Vote for this issue
                Watchers:
                3 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:
                  Fix Release Date:
                  6/Jul/15