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

Add a magic isset method to pagelib.php moodle_page

    XMLWordPrintable

Details

    • Improvement
    • Resolution: Unresolved
    • Minor
    • None
    • Future Dev
    • Other
    • None

    Description

      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;
       }
       

      Attachments

        Issue Links

          Activity

            People

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

              Dates

                Created:
                Updated:

                Clockify

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