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

XMLDB editor broken with PHP 8.1

XMLWordPrintable

    • MOODLE_402_STABLE, MOODLE_403_STABLE
    • MOODLE_402_STABLE, MOODLE_403_STABLE
    • MDL-80827-403
    • MDL-80827-main
    • Hide

      Testing instructions

      1. Download the plugin test.zip and install it
      2. Run the site upgrade
      3. Go to Site admin > Development > XMLDB editor then search for "mod/test/db"
      4. Click on [Load] otherwise click on [Edit]
      5. Click on [Edit] Under Table
      6. Click on [New field]
      7. Set type as "text" and fill other required fields then save
      8. Verify that you don't see any issues like being mentioned in the description
      Show
      Testing instructions Download the plugin test.zip  and install it Run the site upgrade Go to Site admin > Development > XMLDB editor then search for "mod/test/db" Click on [Load] otherwise click on [Edit] Click on [Edit] Under Table Click on [New field] Set type as "text" and fill other required fields then save Verify that you don't see any issues like being mentioned in the description
    • 2
    • Team Hedgehog 2024 Sprint 1.2, Team Hedgehog 2024 Sprint 1.3

      I've just encountered some issues when creating a new Text field in xmldb editor:

      strtolower(): Passing null to parameter #1 ($string) of type string is deprecated
       
      // For this line:
              $length     = strtolower(optional_param('length', NULL, PARAM_ALPHANUM));
      

      I'm not sure why we'd treat lenght as a string in the first place, and then need to strtolower it.

      Fixing this (by making it PARAM_INT) then reveals:

      Whoops\Exception\ErrorException thrown with message "trim(): Passing null to parameter #1 ($string) of type string is deprecated"
       
      Stacktrace:
      #2 Whoops\Exception\ErrorException in /Users/nicols/Sites/moodles/sm/moodle/admin/tool/xmldb/actions/edit_field_save/edit_field_save.class.php:99
      #1 trim in /Users/nicols/Sites/moodles/sm/moodle/admin/tool/xmldb/actions/edit_field_save/edit_field_save.class.php:99
      #0 edit_field_save:invoke in /Users/nicols/Sites/moodles/sm/moodle/admin/tool/xmldb/index.php:67
       
      // For this line:
              $default    = trim($default);
      

        1. (1) 8 Passed -- (Main)MDL-80827.png
          72 kB
          Kim Jared Lucas

            stevani.andolo@moodle.com Stevani Andolo
            dobedobedoh Andrew Lyons
            Huong Nguyen Huong Nguyen
            Andrew Lyons Andrew Lyons
            Kim Jared Lucas Kim Jared Lucas
            Votes:
            0 Vote for this issue
            Watchers:
            6 Start watching this issue

              Created:
              Updated:
              Resolved:

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

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