diff --git a/block_qr.php b/block_qr.php index 8b8c89c..12b540f 100644 --- a/block_qr.php +++ b/block_qr.php @@ -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;