Repository navigation
In review
Description
Moved from catalyst/moodle-report_sql#49, since block instances are better created and migrated by the block plugin (see the discussion on catalyst/moodle-report_sql#53).
Summary
Sites replacing Configurable Reports (BCR, block_configurable_reports) with block_sqlreports must currently re-add every block by hand. Provide a way to convert all existing BCR block instances in one step, with no loss of placement or visibility.
Proposed
- An admin page (preview, then confirm) and a CLI script with
--dry-run. - For each
configurable_reportsrow inblock_instances, create ablock_sqlreportsblock in "List of reports" mode, then remove the old block. - Carry over as-is:
- placement: parent context, "show in subcontexts", page type and sub-page patterns, default region and weight;
- per-page hidden/shown state and position overrides (
block_positions); - per-user collapsed/docked state;
- the
moodle/block:viewandmoodle/block:editpermission overrides; - the block title (BCR's default title is dropped) and the global/course report switches, mapped to "Show site reports" and "Show course reports".
- Each block is migrated in its own transaction, so one failure leaves that block untouched and does not stop the rest. Re-running only picks up blocks that remain.
- Work from database rows only. No BCR code is needed, so it still runs after BCR is removed from disk.
Out of scope
- Importing and publishing reports. Do that with report_sql's "Import from Configurable Reports" and set audiences there. This plugin does not control publishing.
- Migrating BCR permissions or reports that report_sql rejects on import.
Suggested order of operations
- Import the BCR reports with report_sql.
- Publish them and set their audiences.
- Run the block migration.
- Remove BCR.
Related
- Original issue: Migration tool: convert block_configurable_reports block instances to block_sqlreports moodle-report_sql#49
- Earlier attempt in report_sql: feature/49 bcr block migration moodle-report_sql#53
- Display side: the "list of reports" mode (Support a list-of-reports display mode (parity with block_configurable_reports) #4, Add list view mode #6)
Metadata
Metadata
Assignees
Labels
No labels
Activity