Commit 9503d300 authored by Richard Mansfield's avatar Richard Mansfield
Browse files

Allow editing of a textbox block when artefact not found (bug #736665)

When a textbox block references an artefact that has been deleted,
or has become unpublishable by the current user, clicking the block's
configure button causes an error and fails to bring up the config
form.  Avoid this by catching the ArtefactNotFound exception, and
allowing the block to be reconfigured when it contains an invalid

Change-Id: Ia1611a6abf2328c503655dacf01b2c414a603b0a
Signed-off-by: default avatarRichard Mansfield <>
parent 4165e4ab
......@@ -160,8 +160,15 @@ EOF;
$otherblockcount = count($blocks) - 1;
$artefactid = $configdata['artefactid'];
try {
$text = $instance->get_artefact_instance($configdata['artefactid'])->get('description');
catch (ArtefactNotFoundException $e) {
$otherblockcount = 0;
$otherblocksmsg = '<span id="textbox_blockcount">' . $otherblockcount . '</span>';
$otherblocksmsg = get_string('textusedinotherblocks', 'blocktype.internal/textbox', $otherblocksmsg);
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment