Blocktype rendering error when artefact is not found
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Mahara |
Fix Released
|
Low
|
Robert Lyon | ||
15.10 |
Fix Released
|
Low
|
Unassigned |
Bug Description
Mahara 15.10:
version = 2015092910
release = 15.10.0
If an artefact is not found while rending a block instance, the try/catch catches the error - which is good.
But, further down the page when it sets pieformcss => $css (on line 916):
return array('html' => $smarty-
the variable $css has not been declared - giving this error:
[Tue Nov 10 11:47:20 2015] [error] [client 192.168.124.138] [WAR] 63 (blocktype/
[Tue Nov 10 11:47:20 2015] [error] [client 192.168.124.138] Call stack (most recent first):, referer: http://
[Tue Nov 10 11:47:20 2015] [error] [client 192.168.124.138] * log_message(
[Tue Nov 10 11:47:20 2015] [error] [client 192.168.124.138] * error(8, "Undefined variable: css", "/var/www/
[Tue Nov 10 11:47:20 2015] [error] [client 192.168.124.138] * BlockInstance-
[Tue Nov 10 11:47:20 2015] [error] [client 192.168.124.138] * View->build_
[Tue Nov 10 11:47:20 2015] [error] [client 192.168.124.138] * View->build_
[Tue Nov 10 11:47:20 2015] [error] [client 192.168.124.138] * View->build_
[Tue Nov 10 11:47:20 2015] [error] [client 192.168.124.138] , referer: http://
So, before calling the static methods (on lines 822+), we should instantiate the $css variable first.
So when it does fail, $css has already been defined.
no longer affects: | mahara/16.04 |
Changed in mahara: | |
status: | Fix Committed → Fix Released |
Hi Ghada,
Do you have any instructions on how to replicate this error? I tried putting an image in an image block and then deleting the image, but it seems like that particular use case successfully unsets the block instance so this error doesn't happen.
Cheers,
Aaron