Skip to content

Commit

Permalink
MBS-9249: Fix backlink in learningmaps (#103)
Browse files Browse the repository at this point in the history
  • Loading branch information
sh-csg authored Jul 17, 2024
1 parent f4e6a0e commit 7d172e8
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
6 changes: 3 additions & 3 deletions classes/local/hook_callbacks.php
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ class hook_callbacks {
* @param before_http_headers $beforehttpheadershook the hook object
*/
public static function inject_backlinks_into_activity_header(before_http_headers $beforehttpheadershook): void {
global $PAGE;
global $OUTPUT, $PAGE;

if (get_config('mod_learningmap', 'backlinkallowed') == 0) {
return;
Expand Down Expand Up @@ -91,8 +91,8 @@ public static function inject_backlinks_into_activity_header(before_http_headers
}

if ($backlinktext) {
$description = format_module_intro($PAGE->activityname, $PAGE->activityrecord, $PAGE->cm->id);
$PAGE->activityheader->set_description($description . $backlinktext);
$activityheader = $PAGE->activityheader->export_for_template($OUTPUT);
$PAGE->activityheader->set_description($activityheader['description'] . $backlinktext);
}
} catch (Exception $e) {
debugging($e->getMessage());
Expand Down
4 changes: 2 additions & 2 deletions lib.php
Original file line number Diff line number Diff line change
Expand Up @@ -377,8 +377,8 @@ function learningmap_before_http_headers() {
}

if ($backlinktext) {
$description = format_module_intro($PAGE->activityname, $PAGE->activityrecord, $PAGE->cm->id);
$PAGE->activityheader->set_description($description . $backlinktext);
$activityheader = $PAGE->activityheader->export_for_template($OUTPUT);
$PAGE->activityheader->set_description($activityheader['description'] . $backlinktext);
}
} catch (Exception $e) {
debugging($e->getMessage());
Expand Down

0 comments on commit 7d172e8

Please sign in to comment.