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

Moving question categories can leave active database transaction (coding error)

XMLWordPrintable

    • MOODLE_405_STABLE
    • MOODLE_405_STABLE
    • Hide
      1. Open a terminal and tail your web server's error log.
      2. Execute the following Behat scenario:

        $ bin/moodle-docker-compose exec --user www-data webserver php admin/tool/behat/cli/run.php --name="Teacher cannot create a duplicate idnumber within a context by moving a category"
        

        • If not using moodle-docker, run a selenium standalone server and run the following command

          php admin/tool/behat/cli/run.php --name="Teacher cannot create a duplicate idnumber within a context by moving a category"
          

      3. Confirm there are no errors/notices similar to:

        Potential coding error - active database transaction detected during request shutdown
        

      Show
      Open a terminal and tail your web server's error log. Execute the following Behat scenario: $ bin/moodle-docker-compose exec --user www-data webserver php admin/tool/behat/cli/run.php --name="Teacher cannot create a duplicate idnumber within a context by moving a category" If not using moodle-docker, run a selenium standalone server and run the following command php admin /tool/behat/cli/run .php --name= "Teacher cannot create a duplicate idnumber within a context by moving a category" Confirm there are no errors/notices similar to: Potential coding error - active database transaction detected during request shutdown

      This is Problem H from MDL-81614:

      [Mon Sep 09 10:03:53.948243 2024] [php:notice] [pid 96] [client 172.18.0.5:49742] Potential coding error - active database transaction detected during request shutdown:
      * line 261 of /lib/dml/moodle_read_slave_trait.php: call to moodle_database->start_delegated_transaction()
      * line 130 of /question/bank/managecategories/classes/external/move_category.php: call to pgsql_native_moodle_database->start_delegated_transaction()
      * line ? of unknownfile: call to qbank_managecategories\\external\\move_category::execute()
      * line 253 of /lib/external/classes/external_api.php: call to call_user_func_array()
      * line 83 of /lib/ajax/service.php: call to core_external\\external_api::call_external_function()
      , referer: http://webserver/question/bank/managecategories/category.php?courseid=101000
      

      See this code block from MDL-72397 (4.5) - when the exception is thrown we should rollback the database transaction in order to avoid the error triggered when running the Teacher cannot create a duplicate idnumber within a context by moving a category Behat scenario

        1. MDL-83055.png
          183 kB
          Ron Carl Alfon Yu

            pholden Paul Holden
            pholden Paul Holden
            Jun Pataleta Jun Pataleta
            Huong Nguyen Huong Nguyen
            Ron Carl Alfon Yu Ron Carl Alfon Yu
            Votes:
            0 Vote for this issue
            Watchers:
            7 Start watching this issue

              Created:
              Updated:
              Resolved:

                Estimated:
                Original Estimate - 0 minutes
                0m
                Remaining:
                Remaining Estimate - 0 minutes
                0m
                Logged:
                Time Spent - 48 minutes
                48m

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