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

Theme config properties trigger "dynamic property deprecation" in PHP 8.2

XMLWordPrintable

    • MOODLE_402_STABLE
    • MOODLE_402_STABLE
    • Hide
      1. Ensure you are testing with PHP 8.2
      2. Add the following line to the end of theme/boost/config.php:

        $THEME->removedprimarynavitems = ['home'];
        

      3. Initialize Behat, e.g.:

        $ php admin/tool/behat/cli/init.php
        

      4. Confirm there are no deprecation warnings like the following:

        PHP Deprecated:  Creation of dynamic property theme_config::$removedprimarynavitems is deprecated in /var/www/html/lib/outputlib.php on line 773
         
        Deprecated: Creation of dynamic property theme_config::$removedprimarynavitems is deprecated in /var/www/html/lib/outputlib.php on line 773
        

      Show
      Ensure you are testing with PHP 8.2 Add the following line to the end of theme/boost/config.php : $THEME->removedprimarynavitems = ['home']; Initialize Behat, e.g.: $ php admin/tool/behat/cli/init.php Confirm there are no deprecation warnings like the following: PHP Deprecated: Creation of dynamic property theme_config::$removedprimarynavitems is deprecated in /var/www/html/lib/outputlib.php on line 773   Deprecated: Creation of dynamic property theme_config::$removedprimarynavitems is deprecated in /var/www/html/lib/outputlib.php on line 773

      This was partly resolved by MDL-78159 (here), but it only went as far as making current tests pass

      However for third-party theme that define additional $configurable values, e.g. the Workplace theme has the following:

      $THEME->removedprimarynavitems = ['home'];
      

      Which triggers the following:

      PHP Deprecated:  Creation of dynamic property theme_config::$removedprimarynavitems is deprecated in /var/www/html/lib/outputlib.php on line 775
      

      We should ensure that all properties that reach this line are defined in the class

            pholden Paul Holden
            pholden Paul Holden
            Mikel Martín Corrales Mikel Martín Corrales
            Ilya Tregubov Ilya Tregubov
            Ron Carl Alfon Yu Ron Carl Alfon Yu
            Votes:
            0 Vote for this issue
            Watchers:
            12 Start watching this issue

              Created:
              Updated:
              Resolved:

                Estimated:
                Original Estimate - Not Specified
                Not Specified
                Remaining:
                Remaining Estimate - 0 minutes
                0m
                Logged:
                Time Spent - 2 hours, 29 minutes
                2h 29m

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