Commit 61ad4da8 authored by Stéphanie Lanthier's avatar Stéphanie Lanthier Committed by Robert Lyon
Browse files

Bug 1027739: Allow tagged post blocks to be copied



Initial changes as suggested by Stéphanie Lanthier

behatnotneeded

Change-Id: Id8c430e9f3dd4f0a91906d0ca28f45a53499dab8
Signed-off-by: Robert Lyon's avatarRobert Lyon <robertl@catalyst.net.nz>
parent 710108cf
......@@ -493,7 +493,7 @@ EOF;
}
public static function default_copy_type() {
return 'nocopy';
return 'shallow';
}
/**
......
......@@ -1605,6 +1605,19 @@ class BlockInstance {
$newblock->set('configdata', $configdata);
$newblock->commit();
$viewid=$template->get('id');
$bid=get_record('block_instance', 'view', $viewid,'blocktype','taggedposts');
if ($bid && $this->id == $bid->id ) {
$tagrecords = get_records_array('blocktype_taggedposts_tags', 'block_instance', $bid->id, 'tagtype desc, tag', 'tag, tagtype');
$newid=$newblock->get('id');
foreach ($tagrecords as $k => $v) {
$o = new stdClass();
$o->block_instance = $newid;
$o->tag = $v->tag;
$o->tagtype = 1;
insert_record('blocktype_taggedposts_tags', $o);
}
}
return true;
}
......
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