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
artefact.

Change-Id: Ia1611a6abf2328c503655dacf01b2c414a603b0a
Signed-off-by: default avatarRichard Mansfield <richard.mansfield@catalyst.net.nz>
parent 4165e4ab
...@@ -160,7 +160,14 @@ EOF; ...@@ -160,7 +160,14 @@ EOF;
$otherblockcount = count($blocks) - 1; $otherblockcount = count($blocks) - 1;
} }
$artefactid = $configdata['artefactid']; $artefactid = $configdata['artefactid'];
$text = $instance->get_artefact_instance($configdata['artefactid'])->get('description'); try {
$text = $instance->get_artefact_instance($configdata['artefactid'])->get('description');
}
catch (ArtefactNotFoundException $e) {
unset($artefactid);
unset($blocks);
$otherblockcount = 0;
}
} }
$otherblocksmsg = '<span id="textbox_blockcount">' . $otherblockcount . '</span>'; $otherblocksmsg = '<span id="textbox_blockcount">' . $otherblockcount . '</span>';
......
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