Theme and Block simple_certificate

Theme and Block simple_certificate

by Educantel Educantel -
Number of replies: 2

We have installed the simple_certificate block in moodle 3.4.3 with php 7.2.5 and when we want to show the block we get the following error:

Warning:  Illegal string offset 'courses' in /opt/apps/moodle/blocks/simple_certificate/renderer.php on line 145
Excepción - Cannot use string offset as an array
Debug info:
Error code: generalexceptionmessage
Stack trace:
  • line 145 of /blocks/simple_certificate/renderer.php: Error thrown
  • line 120 of /blocks/simple_certificate/renderer.php: call to simple_certificate_tree->get_certs_tree()
  • line 37 of /blocks/simple_certificate/renderer.php: call to simple_certificate_tree->__construct()
  • line 114 of /blocks/simple_certificate/block_simple_certificate.php: call to block_simple_certificate_renderer->block_simple_certificate_tree()
  • line 288 of /blocks/moodleblock.class.php: call to block_simple_certificate->get_content()
  • line 230 of /blocks/moodleblock.class.php: call to block_base->formatted_contents()
  • line 1210 of /lib/blocklib.php: call to block_base->get_content_for_output()
  • line 1262 of /lib/blocklib.php: call to block_manager->create_block_contents()
  • line 374 of /lib/blocklib.php: call to block_manager->ensure_content_created()
  • line 3944 of /lib/outputrenderers.php: call to block_manager->region_has_content()
  • line 40 of /theme/boost/layout/columns2.php: call to core_renderer->blocks()
  • line 1261 of /lib/outputrenderers.php: call to include()
  • line 1191 of /lib/outputrenderers.php: call to core_renderer->render_page_layout()
  • line 112 of /index.php: call to core_renderer->header()
Could it be a problem linked to the theme?
The themes are clean, bootstrap 4, and aardvark.
Average of ratings: -
In reply to Educantel Educantel

Re: Theme and Block simple_certificate

by Gareth J Barnard -
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Plugin developers

Not a problem with any of the themes listed, but a problem with the simple_certificate block.  Which is why I've moved it to the Blocks forum.

In reply to Educantel Educantel

Re: Theme and Block simple_certificate

by Educantel Educantel -

We solve this by changing the following lines in the renderer.php code:

Line 131: change what is by: $ result = array ();

Line 100: where html_writer appears write html_writer :: label ($ url, $ image. $ Certname.) And leave the rest as is.

Average of ratings: Useful (1)