Commit 7f65b938 authored by Ghada El-Zoghbi's avatar Ghada El-Zoghbi Committed by Robert Lyon

Bug 1745042: set link and icon attribute for socialprofiles

When a user shares their socialprofile on their
profile page and another user searches
for that social profile (using elsaticsearch),
the icon attribute is never set.
Because social profiles are external to Mahara,
we can display the link to users.

Sponsored by The Australian National University


Change-Id: I94282bed7904f9d37a50b8e0fd32c5f2d174c704
parent 7b5e45c4
......@@ -312,7 +312,11 @@ class ElasticsearchType_artefact extends ElasticsearchType {
$record->link = 'artefact/plans/plan.php?id=' . $record->parent;
case 'socialprofile' :
// The socialprofile link is for external sites so we can display it for all users.
if ($record->artefacttype == 'socialprofile') {
safe_require ( 'artefact', 'internal' );
$record->note = str_replace ( array (
......@@ -327,7 +331,9 @@ class ElasticsearchType_artefact extends ElasticsearchType {
$record->link = $icons [0]->link;
$record->icon = $icons [0]->icon;
else {
// Instantiate the attribute used by the template.
$record->icon = '';
......@@ -15,7 +15,7 @@
<img src="{$record->icon}" alt="{$record->note}">
<h3 class="title list-group-item-heading text-inline">
{if $record->link}
<a href="{$WWWROOT}{$record->link}">
<a href="{$record->link}">
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