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

PHP 8.0: @ Error Suppression operator does not silent fatal errors

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 3.10.1, 3.11, 4.0
    • Fix Version/s: 3.11
    • Component/s: Backup
    • Labels:

      Description

      See https://php.watch/versions/8.0/fatal-error-suppression

      unittest runs are full of similar errors:

      365) mod_data_restore_date_testcase::test_restore_dates
      TypeError: fclose(): Argument #1 ($stream) must be of type resource, null given
       
      /home/marina/repositories/lms/master/moodle/backup/util/loggers/file_logger.class.php:57
      /home/marina/repositories/lms/master/moodle/backup/util/dbops/backup_controller_dbops.class.php:85
      /home/marina/repositories/lms/master/moodle/backup/controller/backup_controller.class.php:430
      /home/marina/repositories/lms/master/moodle/backup/controller/backup_controller.class.php:206
      /home/marina/repositories/lms/master/moodle/backup/controller/backup_controller.class.php:161
      /home/marina/repositories/lms/master/moodle/lib/phpunit/classes/restore_date_testcase.php:82
      /home/marina/repositories/lms/master/moodle/mod/data/tests/restore_date_test.php:74
      /home/marina/repositories/lms/master/moodle/lib/phpunit/classes/advanced_testcase.php:80
       
      366) mod_feedback_events_testcase::test_delete_course
      TypeError: fclose(): supplied resource is not a valid stream resource
       
      /home/marina/repositories/lms/master/moodle/backup/util/loggers/file_logger.class.php:53
      /home/marina/repositories/lms/master/moodle/backup/controller/backup_controller.class.php:208
      /home/marina/repositories/lms/master/moodle/backup/controller/backup_controller.class.php:161
      /home/marina/repositories/lms/master/moodle/admin/tool/recyclebin/classes/category_bin.php:130
      /home/marina/repositories/lms/master/moodle/admin/tool/recyclebin/lib.php:185
      /home/marina/repositories/lms/master/moodle/lib/moodlelib.php:5128
      /home/marina/repositories/lms/master/moodle/mod/feedback/tests/events_test.php:342
      /home/marina/repositories/lms/master/moodle/lib/phpunit/classes/advanced_testcase.php:80
      

        Attachments

          Activity

            People

            Assignee:
            marina Marina Glancy
            Reporter:
            marina Marina Glancy
            Peer reviewer:
            Peter Dias Peter Dias
            Integrator:
            Eloy Lafuente (stronk7) Eloy Lafuente (stronk7)
            Tester:
            CiBoT CiBoT
            Participants:
            Component watchers:
            Adrian Greeve, Jake Dallimore, Mathew May, Mihail Geshoski, Peter Dias, Sujith Haridasan
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved:
              Fix Release Date:
              17/May/21

                Time Tracking

                Estimated:
                Original Estimate - Not Specified
                Not Specified
                Remaining:
                Remaining Estimate - 0 minutes
                0m
                Logged:
                Time Spent - 56 minutes
                56m