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

One more case receiving nulls in str_replace() function call

    XMLWordPrintable

Details

    • MOODLE_401_STABLE, MOODLE_402_STABLE
    • MOODLE_401_STABLE
    • MDL-77081-401
    • Hide
      1. Ensure Behat passes on PHP 8.1:

        $ bin/moodle-docker-compose exec --user www-data webserver php admin/tool/behat/cli/run.php --name="Choose rubric as grading strategy"
        Running single behat site:
        Moodle 4.2dev (Build: 20230126), 880462a1685f710ed4f6628d31c2fd7e67e0df73
        Php: 8.1.14, pgsql: 12.13 (Debian 12.13-1.pgdg110+1), OS: Linux 4.15.0-202-generic x86_64
        Run optional tests:
        - Accessibility: No
        Server OS "Linux", Browser: "chrome"
        Started at 31-01-2023, 18:06
        ......................
         
        1 scenario (1 passed)
        22 steps (22 passed)
        0m5.75s (72.41Mb
        

      Show
      Ensure Behat passes on PHP 8.1: $ bin/moodle-docker-compose exec --user www-data webserver php admin/tool/behat/cli/run.php --name="Choose rubric as grading strategy" Running single behat site: Moodle 4.2dev (Build: 20230126), 880462a1685f710ed4f6628d31c2fd7e67e0df73 Php: 8.1.14, pgsql: 12.13 (Debian 12.13-1.pgdg110+1), OS: Linux 4.15.0-202-generic x86_64 Run optional tests: - Accessibility: No Server OS "Linux", Browser: "chrome" Started at 31-01-2023, 18:06 ......................   1 scenario (1 passed) 22 steps (22 passed) 0m5.75s (72.41Mb

    Description

      With the META about these cases already closed (MDL-75976), adding this new issue straight under the PHP 8.1 epic.

      It seems that there is one more case of PHP functions being called with unexpected null values. Curiously, the case was not there 1-2 weeks ago when some complete runs were performed.

      Can be reproduced running Behat (goutte):

      • Link: https://ci.moodle.org/view/Testing/job/DEV.81%20-%20PHP%208.1%20Behat%20(non-js)%20-%20master/105/
      • Failure:

        --- Failed steps:
         
        001 Scenario: Choose rubric as grading strategy # /var/www/html/mod/workshop/tests/behat/grading_strategy.feature:94
              When I click on "Assessment form" "link"  # /var/www/html/mod/workshop/tests/behat/grading_strategy.feature:98
                Moodle exception: Exception - Unknown error type: str_replace(): Passing null to parameter #2 ($replace) of type array|string is deprecated in [dirroot]/lib/formslib.php on line 3198More information about this error
                
                Exception - Unknown error type: str_replace(): Passing null to parameter #2 ($replace) of type array|string is deprecated in [dirroot]/lib/formslib.php on line 3198
                More information about this error
                
                
                    
                Debug info: 
                 
                Error code: generalexceptionmessage
                    
                        
                ×
                        
                Dismiss this notification
                    
                
                	* line 157 of /lib/behat/lib.php: Exception thrown
                	* line ? of unknownfile: call to behat_error_handler()
                	* line 3198 of /lib/formslib.php: call to str_replace()
                	* line 232 of /lib/form/group.php: call to
                MoodleQuickForm_Renderer->startGroup()
                	* line 1642 of /lib/pear/HTML/QuickForm.php: call to
                MoodleQuickForm_group->accept()
                	* line 1996 of /lib/formslib.php: call to HTML_QuickForm->accept()
                	* line 1685 of /lib/pear/HTML/QuickForm.php: call to
                MoodleQuickForm->accept()
                	* line 445 of /lib/pear/HTML/Common.php: call to HTML_QuickForm->toHtml()
                	* line 1027 of /lib/formslib.php: call to HTML_Common->display()
                	* line 82 of /mod/workshop/editform.php: call to moodleform->display()
                 (Exception)
        

      Adding both the "Forms" and "Workshop" components because I've not looked which one the responsibility is.

      Attachments

        1. 401.png
          401.png
          83 kB
        2. master.png
          master.png
          81 kB

        Issue Links

          Activity

            People

              pholden Paul Holden
              stronk7 Eloy Lafuente (stronk7)
              Eloy Lafuente (stronk7) Eloy Lafuente (stronk7)
              Andrew Lyons Andrew Lyons
              Ron Carl Alfon Yu Ron Carl Alfon Yu
              Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Time Tracking

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

                  Clockify

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