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

Add a magic isset method to pagelib.php moodle_page

XMLWordPrintable

    • Icon: Improvement Improvement
    • Resolution: Deferred
    • Icon: Minor Minor
    • None
    • Future Dev
    • Other
    • None

      The moodle_page class uses magic methods for getting and setting properties.

      These magic methods lead to problems when trying to use isset on them. It provides results that are not expected.

      To avoid this "gotcha" it would be good to add a magic isset method to provide the expected outcome.

      Note: We discourage the use of magic method for precisely this reason.

      Proof of concept from Andrew:

      public function __isset($name): bool {
          return $this->__get($name) !== null;
       }
       

            Unassigned Unassigned
            abgreeve Adrian Greeve
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved:

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