MDL-70750 mod_survey: Fix warning for undefined offset.
authorIlya Tregubov <ilya@moodle.com>
Wed, 9 Jun 2021 04:06:10 +0000 (06:06 +0200)
committerIlya Tregubov <ilya@moodle.com>
Mon, 21 Jun 2021 06:41:48 +0000 (08:41 +0200)
lib/graphlib.php

index 64db34a..11aad5f 100644 (file)
@@ -307,7 +307,7 @@ class graph {
         //print "$thisX, $thisY <br />";
 
         if (($bar!='none') && (string)$thisY != 'none') {
-            if ($relatedset = $this->offset_relation[$set]) {                               // Moodle
+            if (isset($this->offset_relation[$set]) && $relatedset = $this->offset_relation[$set]) {
                 $yoffset = $this->calculated['y_plot'][$relatedset][$index];                // Moodle
             } else {                                                                        // Moodle
                 $yoffset = 0;                                                               // Moodle