← Back to team overview

mahara-contributors team mailing list archive

[Bug 1514641] A change has been merged

 

Reviewed:  https://reviews.mahara.org/6425
Committed: https://git.mahara.org/mahara/mahara/commit/865fa5b1a6866005532467177211e8109eac29e9
Submitter: Aaron Wells (aaronw@xxxxxxxxxxxxxxx)
Branch:    16.04_STABLE

commit 865fa5b1a6866005532467177211e8109eac29e9
Author: Robert Lyon <robertl@xxxxxxxxxxxxxxx>
Date:   Tue Feb 9 10:21:10 2016 +1300

Bug #1514641: Avoid undefined variable 'css' in block render

To avoid lines in error log

Behatnotneeded

Change-Id: I7024d0c1aa764d27c7d3a03dc8c01ae2e6031562
Signed-off-by: Robert Lyon <robertl@xxxxxxxxxxxxxxx>
(cherry picked from commit f600592d3ba07abd5d71d5a74ac03f7695e6aead)

-- 
You received this bug notification because you are a member of Mahara
Contributors, which is subscribed to Mahara.
Matching subscriptions: Subscription for all Mahara Contributors -- please ask on #mahara-dev or mahara.org forum before editing or unsubscribing it!
https://bugs.launchpad.net/bugs/1514641

Title:
  Blocktype rendering error when artefact is not found

Status in Mahara:
  Fix Committed
Status in Mahara 15.10 series:
  Fix Committed
Status in Mahara 16.04 series:
  Fix Committed

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->fetch('view/blocktypecontainerediting.tpl'), 'javascript' =>
  $js, 'pieformcss' => $css);

  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/lib.php:913) Undefined variable: css, referer: http://d.acttqi.mahara/view/blocks.php?id=2149&;
  [Tue Nov 10 11:47:20 2015] [error] [client 192.168.124.138] Call stack (most recent first):, referer: http://d.acttqi.mahara/view/blocks.php?id=2149&;
  [Tue Nov 10 11:47:20 2015] [error] [client 192.168.124.138]   * log_message("Undefined variable: css", 8, true, true, "/var/www/acttqi/mahara/htdocs/blocktype/lib.php", 913) at /var/www/acttqi/mahara/htdocs/lib/errors.php:441, referer: http://d.acttqi.mahara/view/blocks.php?id=2149&;
  [Tue Nov 10 11:47:20 2015] [error] [client 192.168.124.138]   * error(8, "Undefined variable: css", "/var/www/acttqi/mahara/htdocs/blocktype/lib.php", 913, array(size 14)) at /var/www/acttqi/mahara/htdocs/blocktype/lib.php:913, referer: http://d.acttqi.mahara/view/blocks.php?id=2149&;
  [Tue Nov 10 11:47:20 2015] [error] [client 192.168.124.138]   * BlockInstance->render_editing() at /var/www/acttqi/mahara/htdocs/lib/view.php:2082, referer: http://d.acttqi.mahara/view/blocks.php?id=2149&;
  [Tue Nov 10 11:47:20 2015] [error] [client 192.168.124.138]   * View->build_column(1, 3, true, false) at /var/www/acttqi/mahara/htdocs/lib/view.php:2043, referer: http://d.acttqi.mahara/view/blocks.php?id=2149&;
  [Tue Nov 10 11:47:20 2015] [error] [client 192.168.124.138]   * View->build_columns(1, true, false) at /var/www/acttqi/mahara/htdocs/lib/view.php:2028, referer: http://d.acttqi.mahara/view/blocks.php?id=2149&;
  [Tue Nov 10 11:47:20 2015] [error] [client 192.168.124.138]   * View->build_rows(true) at /var/www/acttqi/mahara/htdocs/view/blocks.php:191, referer: http://d.acttqi.mahara/view/blocks.php?id=2149&;
  [Tue Nov 10 11:47:20 2015] [error] [client 192.168.124.138] , referer: http://d.acttqi.mahara/view/blocks.php?id=2149&;

  
  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.

To manage notifications about this bug go to:
https://bugs.launchpad.net/mahara/+bug/1514641/+subscriptions


References