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

Deprecated: function_exists(): Passing null to parameter of type string when building CSS (PHP 8.1)

    XMLWordPrintable

Details

    • MOODLE_401_STABLE, MOODLE_402_STABLE
    • MOODLE_401_STABLE, MOODLE_402_STABLE
    • MDL-78055-401
    • MDL-78055-402
    • Hide

      As a workaround, you can set a no-op extracsscallback function in your theme.

      $THEME->extrascsscallback = 'theme_mytheme_get_extra_scss';

      (THX to #jrchamp)

      Show
      As a workaround, you can set a no-op extracsscallback function in your theme. $THEME->extrascsscallback = 'theme_mytheme_get_extra_scss'; (THX to #jrchamp)
    • Hide
      1. Ensure you are testing with PHP 8.1
      2. Download the Snap theme version 4.0.7 (2023041100) to reproduce
        • Note there is another unrelated bug in the theme itself, we're only fixing the reported error here
      3. Copy snap/ directory from download to your site $CFG->dirroot/theme directory
      4. Run the following command to initialize Behat:

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

      5. Confirm there is no "Deprecated: function_exists(): Passing null to parameter #1" debugging displayed while building theme CSS for Snap (you can ignore the "file not found" error as mentioned above)
      Show
      Ensure you are testing with PHP 8.1 Download the Snap theme version 4.0.7 (2023041100) to reproduce Note there is another unrelated bug in the theme itself, we're only fixing the reported error here Copy snap/ directory from download to your site $CFG->dirroot/theme directory Run the following command to initialize Behat: $ php admin/tool/behat/cli/init.php -a Confirm there is no "Deprecated: function_exists(): Passing null to parameter #1" debugging displayed while building theme CSS for Snap (you can ignore the "file not found" error as mentioned above)

    Description

      The function_exists() in lib/outputlib.php shows a deprecation warning in PHP 8.1:

      Passing null to parameter #1 ($function) of type string is deprecated of in lib/outputlib.php on line 1606

      Attachments

        Activity

          People

            pholden Paul Holden
            rdebleu Renaat Debleu
            Andrew Lyons Andrew Lyons
            Sara Arjona (@sarjona) Sara Arjona (@sarjona)
            Ron Carl Alfon Yu Ron Carl Alfon Yu
            Matteo Scaramuccia, David Woloszyn, Huong Nguyen, Jake Dallimore, Meirza, Michael Hawkins, Raquel Ortega, Safat Shahin, Stevani Andolo, Huong Nguyen, Bas Brands, Mathew May, Amaia Anabitarte, Carlos Escobedo, Laurent David, Mikel Martín Corrales, Sabina Abellan, Sara Arjona (@sarjona)
            Votes:
            0 Vote for this issue
            Watchers:
            8 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:
              14/Aug/23

              Time Tracking

                Estimated:
                Original Estimate - 0 minutes
                0m
                Remaining:
                Remaining Estimate - 0 minutes
                0m
                Logged:
                Time Spent - 1 hour, 31 minutes
                1h 31m