Skip to content

Commit

Permalink
MBS-9397: Remove out(false)
Browse files Browse the repository at this point in the history
  • Loading branch information
fdagner committed Oct 6, 2024
1 parent 77e8557 commit c2a3a70
Showing 1 changed file with 2 additions and 8 deletions.
10 changes: 2 additions & 8 deletions block_qr.php
Original file line number Diff line number Diff line change
Expand Up @@ -136,15 +136,9 @@ public function get_content() {
$qrcodelink = $qrcodecontent;
} else {
$description = $module->name;
$qrcodecontent = $format->get_view_url($module->sectionnum)->out(false);
$qrcodecontent = $format->get_view_url($module->sectionnum);
$anchor = 'module-' . $id;
// Check whether $qrcodecontent is an object and the set_anchor method exists.
if (is_object($qrcodecontent) && method_exists($qrcodecontent, 'set_anchor')) {
$qrcodecontent->set_anchor($anchor);
} else {
// Error handling if set_anchor does not exist or $qrcodecontent is a string.
$qrcodecontent = (string)$qrcodecontent . '#' . $anchor;
}
$qrcodecontent->set_anchor($anchor);
$qrcodelink = $qrcodecontent;
}
break;
Expand Down

0 comments on commit c2a3a70

Please sign in to comment.