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

Under some circumstances some block_instances aren't deleted...

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor
    • Resolution: Won't Fix
    • Affects Version/s: 1.6
    • Fix Version/s: None
    • Component/s: Blocks
    • Labels:
      None
    • Environment:
      All
    • Affected Branches:
      MOODLE_16_STABLE

      Description

      If you delete some module from the blocks directory (under dirroot) and then, as admin, you navigate to the Admin/Blocks page and delete the block, the block itself is properly deleted from the block table but their instances (block_instance) remains!

      Although it's not critical, we should perform some house-cleaning to purge block_instances of orphaned records.

      Proposal:

      Everytime the admin arrive to the Admin/Blocks page, the records (block_instances ) returned by this query should be deleted:

      SELECT *

      FROM block_instance bi

      WHERE NOT EXISTS (

      SELECT 'x'

      FROM block b

      WHERE b.id = bi.blockid)

      (test it under moodle.org, there are some orphans there too)

        Attachments

          Activity

            People

            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: