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

Resetting dashboards containing a missing block displays an exception

    XMLWordPrintable

Details

    • MOODLE_311_STABLE, MOODLE_400_STABLE, MOODLE_401_STABLE
    • MOODLE_400_STABLE, MOODLE_401_STABLE
    • MDL-75346-reset_dashboard_error-400
    • MDL-75346-reset_dashboard_error-401
    • MDL-75346-reset_dashboard_error
    • Hide

      Test 1

      1. Set up a Moodle site with two non-admin users.
      2. Install block_coursesearch (ensure the block's version is compatible with the Moodle site's version).
      3. From Site administration > Appearance > Default Dashboard page turn edit mode on and add the Basic course search block.
      4. Click Reset Dashboard for all users.
      5. Delete the blocks/coursesearch subdirectory.
      6. You may be taken to the Plugins check page showing the plugin as missing from disk. Click Upgrade Moodle database now to return to the admin pages.
      7. From Site administration > Appearance > Default Dashboard page click Reset Dashboard for all users.
      8. Log in as the first non-admin user.

      Expected results

      There should be no error messages on login.

      Test 2

      1. Enable debugging on the site (Debug messages: DEVELOPER, Display debug messages: Yes).
      2. Log in as the second non-admin user.

      Expected results

      The following error message should appear near the top of the page:

      Unable to copy block-specific data for original block instance: <ID1> to new block instance: <ID2> for block: coursesearch

      Where <ID1> and <ID2> are numbers.

      Show
      Test 1 Set up a Moodle site with two non-admin users. Install block_coursesearch (ensure the block's version is compatible with the Moodle site's version). From Site administration > Appearance > Default Dashboard page turn edit mode on and add the Basic course search block. Click Reset Dashboard for all users . Delete the blocks/coursesearch subdirectory. You may be taken to the Plugins check page showing the plugin as missing from disk. Click Upgrade Moodle database now to return to the admin pages. From Site administration > Appearance > Default Dashboard page click Reset Dashboard for all users . Log in as the first non-admin user. Expected results There should be no error messages on login. Test 2 Enable debugging on the site ( Debug messages: DEVELOPER , Display debug messages: Yes ). Log in as the second non-admin user. Expected results The following error message should appear near the top of the page: Unable to copy block-specific data for original block instance: <ID1> to new block instance: <ID2> for block: coursesearch Where <ID1> and <ID2> are numbers.
    • 1
    • Team Hedgehog Sprint 1.3

    Description

      If a block was added to the dashboard but the source code is no longer present (i.e. missing from disk), if you click Reset Dashboard for all users then upon login users will see:

      Exception - Call to a member function instance_copy() on bool

      More information about this error
      Debug info:
      Error code: generalexceptionmessage
      Stack trace:

          line 124 of /my/lib.php: Error thrown
          line 139 of /my/index.php: call to my_copy_page()

      Steps to reproduce this issue

      1. Set up a Moodle site with at least one non-admin user.
      2. Install a block, for example block_mycoursestatus.
      3. From Site administration > Appearance > Default Dashboard page turn edit mode on and add the Mycourse Status block.
      4. Click Reset Dashboard for all users.
      5. Delete subdirectory blocks/mycoursestatus.
      6. You may be taken to the Plugins check page showing the plugin as missing from disk. Click Upgrade Moodle database now to return to the admin pages.
      7. From Site administration > Appearance > Default Dashboard page click Reset Dashboard for all users.
      8. Log in as a user.

      Expected results

      Either no error should appear to the user, or an error with information helpful to a site admin or sysadmin should appear, such as listing the name of the missing block, or the instance ID from mdl_block_instances.

      Actual results

      Error message Exception - Call to a member function instance_copy() on bool with no clue as to the cause.

      Attachments

        1. 400.png
          400.png
          185 kB
        2. 401.png
          401.png
          226 kB
        3. Master.png
          Master.png
          188 kB

        Activity

          People

            leonstr Leon Stringer
            leonstr Leon Stringer
            Huong Nguyen Huong Nguyen
            Paul Holden Paul Holden
            Ron Carl Alfon Yu Ron Carl Alfon Yu
            David Woloszyn, Huong Nguyen, Jake Dallimore, Meirza, Michael Hawkins, Raquel Ortega, Safat Shahin, Stevani Andolo
            Votes:
            0 Vote for this issue
            Watchers:
            6 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:
              16/Jan/23

              Time Tracking

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