Commit d1e69948 authored by Robert Lyon's avatar Robert Lyon

Bug 1833301: Handle export of text block with missing 'text' attribute

We will just treat this as an empty string

behatnotneeded

Change-Id: Ic8e22f4d56f8c22b635658bdf87ba0fd07497cc8
Signed-off-by: Robert Lyon's avatarRobert Lyon <robertl@catalyst.net.nz>
parent 9844b408
......@@ -155,7 +155,8 @@ class PluginBlocktypeText extends MaharaCoreBlocktype {
*/
public static function export_blockinstance_config_leap(BlockInstance $bi) {
$configdata = $bi->get('configdata');
$result = array('text' => json_encode(array($configdata['text'])));
$text = !empty($configdata['text']) ? json_encode(array($configdata['text'])) : '';
$result = array('text' => $text);
return $result;
}
......
Markdown is supported
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