Commit d45ff094 authored by Lisa Seeto's avatar Lisa Seeto Committed by Robert Lyon

Bug 1839223: When creating a page via tags, the copied blocks have the wrong text for the tags

when creating a block, run through all the tags and if
they match institution style tag, then construct the tag
with the institution display name and the tag.


Change-Id: If6b92d1c2d993368f057f1b6c71354ce6d8cbb3c
Signed-off-by: default avatarLisa Seeto <>
(cherry picked from commit 1ea01a36)
parent 7bb843ed
......@@ -836,6 +836,14 @@ function set_view_title_and_description(Pieform $form, $values) {
foreach($bv['ids'] as $bid) {
$configdata = unserialize(get_field('block_instance', 'configdata', 'id', $bid));
$tags = get_column('tag', 'tag', 'resourcetype', 'blocktype', 'resourceid', $bid);
foreach($tags as &$t) {
if (preg_match('/^tagid\_(.*)/', $t, $matches)) {
if ($itag = get_record('tag', 'id', $matches[1])) {
$instname = get_field('institution', 'displayname', 'id', $itag->resourceid);
$t = $instname . ': ' . $itag->tag;
$id = create_block($bk, $configdata, $view, $currentcolumn, array('oldid' => $bid, 'tags' => $tags));
$currentcolumn = (($currentcolumn +1) % $maxcols) ? ($currentcolumn +1) % $maxcols : $maxcols;
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