Browse Source

added support for sections

Josh 4 years ago
parent
commit
1732bacf52
2 changed files with 9 additions and 3 deletions
  1. 1 1
      config/view.php
  2. 8 2
      storage/sections/weight/processor.php

+ 1 - 1
config/view.php

@@ -14,7 +14,7 @@ return [
     */
 
     'paths' => [
-        storage_path(),
+        storage_path(), //TODO: research if there are security risks.
         resource_path('views'),
     ],
 

+ 8 - 2
storage/sections/weight/processor.php

@@ -10,7 +10,7 @@
  $contentData = json_decode($section->content_data, true);
 
  if(!isset($contentData['weights'])){
-     $contentData['weights'] = [];
+     $contentData['weightLog'] = [];
  }
 
 
@@ -22,7 +22,13 @@ $currentWeight = [
     'effectiveDate' => $effectiveDate
 ];
 
-$weightLog = $contentData['weightLog'];
+
+$weightLog = [];
+
+if(isset($contentData['weightLog'])){
+    $weightLog = $contentData['weightLog'];
+}
+
 $weightLog[] = $currentWeight;