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

Loading an unknown customfield handler produced a PHP type error

    XMLWordPrintable

Details

    Description

      Found while looking at MDL-77532

      If the customfield handler isn't present, then we receive an obscure PHP type error:

      Fatal error: Uncaught TypeError: stripos(): Argument #1 ($haystack) must be of type string, stdClass given in /opt/moodle/master/src/lib/setuplib.php:580 Stack trace: #0 /opt/moodle/master/src/lib/setuplib.php(580): stripos() #1 /opt/moodle/master/src/lib/setuplib.php(363): get_exception_info() #2 [internal function]: default_exception_handler() #3 {main} thrown in /opt/moodle/master/src/lib/setuplib.php on line 580
      

      Instead of the intended exception (once fixed):

      Because the arguments passed to the exception constructor are misordered

      Attachments

        Issue Links

          Activity

            People

              pholden Paul Holden
              pholden Paul Holden
              David Matamoros David Matamoros
              Jun Pataleta Jun Pataleta
              CiBoT CiBoT
              Adrian Greeve, David Woloszyn, Huong Nguyen, Jake Dallimore, Meirza, Michael Hawkins, Raquel Ortega, Safat Shahin, Stevani Andolo, David Woloszyn, Huong Nguyen, Jake Dallimore, Meirza, Michael Hawkins, Raquel Ortega, Safat Shahin, Stevani Andolo
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:
                13/Mar/23

                Time Tracking

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