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

Stored notifications miss contexturl and contextname

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Major Major
    • 2.9.1
    • 2.9
    • Messages
    • MOODLE_29_STABLE
    • MOODLE_29_STABLE
    • MDL-50561-master
    • 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

      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

            jleyva Juan Leyva
            jleyva Juan Leyva
            Simey Lameze Simey Lameze
            David Monllaó David Monllaó
            Adrian Greeve Adrian Greeve
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved:

                Error rendering 'clockify-timesheets-time-tracking-reports:timer-sidebar'. Please contact your Jira administrators.