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

PHP 8.1 Deprecation warnings when editing roles on a site with missing plugins

XMLWordPrintable

    • MOODLE_401_STABLE
    • MOODLE_401_STABLE, MOODLE_402_STABLE
    • MDL-77930-401
    • MDL-77930-master
    • Hide

      Notes

      • All the tests must be done with PHP 8.1.
      • The need to be performed with both MOODLE_401_STABLE and master.
      • The test requires removing some plugins.
      • DEBUG DEVELOPER and display errors should be enabled.

      Before the patch (without the changes applied). Reproduce the problem.

      Manually, remove the plugin folder from code (for example the mod/chat), but do not uninstall the plugin.
      It should show as "missing from disk" on the Plugins overview page.

      Logged in as admin visit http://your_site_url/admin/search.php
      Go to the role page from Site administration > Users > Define roles.
      Edit any role (for example, Teacher).
      Scroll down to see the capabilities.
      Verify that you see "Deprecated: file_exists(): Passing null to parameter #1 ($filename) of type string is deprecated" warnings.

      After the patch (with the changes). Confirm the fix.
      Ensure that you still have plugins "missing" on your site.
      Logged in as admin visit http://your_site_url/admin/search.php
      Go to the role page from Site administration > Users > Define roles.
      Edit any role (for example, Teacher).
      Scroll down to see the capabilities.
      Verify that you don't get any "PHP Deprecated" warnings any more.

      Show
      Notes All the tests must be done with PHP 8.1. The need to be performed with both MOODLE_401_STABLE and master. The test requires removing some plugins. DEBUG DEVELOPER and display errors should be enabled. Before the patch (without the changes applied). Reproduce the problem. Manually, remove the plugin folder from code (for example the mod/chat), but do not uninstall the plugin. It should show as "missing from disk" on the Plugins overview page. Logged in as admin visit http://your_site_url/admin/search.php Go to the role page from Site administration > Users > Define roles. Edit any role (for example, Teacher). Scroll down to see the capabilities. Verify that you see "Deprecated: file_exists(): Passing null to parameter #1 ($filename) of type string is deprecated" warnings. After the patch (with the changes). Confirm the fix. Ensure that you still have plugins "missing" on your site. Logged in as admin visit http://your_site_url/admin/search.php Go to the role page from Site administration > Users > Define roles. Edit any role (for example, Teacher). Scroll down to see the capabilities. Verify that you don't get any "PHP Deprecated" warnings any more.
    • 1
    • Team Hedgehog 2023 Sprint 2.0
    • Small

      On a Moodle 4.1.2+ (Build: 20230414) site that has some missing plugins, the following PHP deprecated warnings are shown.

      PHP version is 8.1.17

      These warnings are shown when visiting the edit role page. There are some missing plugins on the site.

      Usually capabilities from missing plugins show with a "plugnname/capability ???"

       

       

      Deprecated: file_exists(): Passing null to parameter #1 ($filename) of type string is deprecated in /var/www/html/moodle/lib/accesslib.php on line 2673
      Deprecated: file_exists(): Passing null to parameter #1 ($filename) of type string is deprecated in /var/www/html/moodle/lib/accesslib.php on line 2649
      Deprecated: file_exists(): Passing null to parameter #1 ($filename) of type string is deprecated in /var/www/html/moodle/lib/accesslib.php on line 2673
      Deprecated: file_exists(): Passing null to parameter #1 ($filename) of type string is deprecated in /var/www/html/moodle/lib/accesslib.php on line 2649
      Deprecated: file_exists(): Passing null to parameter #1 ($filename) of type string is deprecated in /var/www/html/moodle/lib/accesslib.php on line 2649
      Deprecated: file_exists(): Passing null to parameter #1 ($filename) of type string is deprecated in /var/www/html/moodle/lib/accesslib.php on line 2649
      Deprecated: file_exists(): Passing null to parameter #1 ($filename) of type string is deprecated in /var/www/html/moodle/lib/accesslib.php on line 2649
      Deprecated: file_exists(): Passing null to parameter #1 ($filename) of type string is deprecated in /var/www/html/moodle/lib/accesslib.php on line 2649
      Deprecated: file_exists(): Passing null to parameter #1 ($filename) of type string is deprecated in /var/www/html/moodle/lib/accesslib.php on line 2673
      

       

       

            rjnl Rajneel Totaram
            rjnl Rajneel Totaram
            Raquel Ortega Raquel Ortega
            Huong Nguyen Huong Nguyen
            Kim Jared Lucas Kim Jared Lucas
            Votes:
            0 Vote for this issue
            Watchers:
            6 Start watching this issue

              Created:
              Updated:
              Resolved:

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

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