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

get_name() should use get_called_class() instead of __CLASS__

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 2.6
    • Fix Version/s: 2.6
    • Component/s: Events API
    • Labels:
    • Sprint:
      BACKEND Sprint 3

      Description

      If a event doesn't implement get_name() method, the name of the event defaults to "core: base" always, instead of expected "frankenstyle: class_name", since _CLASS_ always returns the class it is called in.
      http://www.php.net/manual/en/language.constants.predefined.php#44214

      We can use get_called_class() instead.

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              ankit_frenz Ankit Agarwal
              Reporter:
              ankit_frenz Ankit Agarwal
              Peer reviewer:
              Mark Nelson
              Integrator:
              Sam Hemelryk
              Tester:
              Petr Skoda
              Participants:
              Component watchers:
              Amaia Anabitarte, Carlos Escobedo, Ferran Recio, Sara Arjona (@sarjona), Víctor Déniz Falcón
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:
                Fix Release Date:
                18/Nov/13