PHP notice

Undefined variable: value

/var/www/vhosts/ridie.org/protected/components/study/StudyWordDocumentBuilder.php(284)

272     }
273     elseif ($abstractInputType == Study::AbstractInputTypeRepeatedDescribedFileUploadOrLink) 
274     {
275       foreach ($study->$relation as $relatedModelInstance)
276       {
277           if($relatedModelInstance->originalFileName != null)
278           {
279             $value = $relatedModelInstance->description . ": " . $relatedModelInstance->originalFileName;                        
280             $section->addText(self::convertSmartQuotes($value) , $fontStyle, $paragraphStyle);               
281           }
282           else
283           {
284             $value .= $relatedModelInstance->description . ": " . $relatedModelInstance->link;                                                
285             $section->addText(self::convertSmartQuotes($value) , $fontStyle, $paragraphStyle);               
286           }
287       }
288     }
289     else
290     {
291       throw new Exception("For attribute '$attributeName', '$abstractInputType' is an unknown field type!");
292     }
293 
294   }
295   
296 }

Stack Trace

#0
+
 /var/www/vhosts/ridie.org/protected/components/study/StudyWordDocumentBuilder.php(182): StudyWordDocumentBuilder::writeFieldValue(Study, "studyStudymaterials", array("RelatedModel" => "StudyStudymaterial", "Relation" => "studyStudymaterials", "Label" => "Upload Study Materials", "Description" => "It is helpful for other researchers to be able to see survey ins...", ...), PHPWord_Section, ...)
177       if($description != '') 
178       { $section->addText($description, $fieldDescriptionFontStyle, $fieldDescriptionParagraphStyle); }
179 
180       if($study != null)
181       {
182         self::writeFieldValue($study, $attributeName, $attributeMapItem, $section, $fieldValueFontStyle, $fieldValueParagraphStyle);
183 
184         self::writeChangeHistory($study, $attributeName, $section, $changeHistoryFontStyle, $changeHistoryParagraphStyle, $changeHistoryTableStyle, $changeHistoryDateCellSize, $changeHistoryValueCellSize);
185       }
186       
187       $section->addText('', $fieldSpacingFontStyle, $fieldSpacingParagraphStyle);           
#1
+
 /var/www/vhosts/ridie.org/protected/components/study/StudyMaterialsArchiveBuilder.php(49): StudyWordDocumentBuilder::buildWordDocument("/tmp/Study_66065c2001f768.56221101.docx", Study, false, false, ...)
44             {
45                 $showPrivate = StudyRegistrationPhaseLogic::isStudyStoppedOrCompleted($study);
46                 $showHidden = false; 
47                 $respectPerFieldVisibilitySettings = !StudyRegistrationPhaseLogic::isStudyStoppedOrCompleted($study);
48 
49                 StudyWordDocumentBuilder::buildWordDocument($studyFileTempPath, $study, $showPrivate, $showHidden, $respectPerFieldVisibilitySettings);
50             }
51             else if ($downloadVisibility === CommonConstants::StudyAttachmentVisibilityPublicPrivate)
52             {
53                 StudyWordDocumentBuilder::buildWordDocument($studyFileTempPath, $study, true, true, false);        
54             }
#2
+
 /var/www/vhosts/ridie.org/protected/controllers/SiteController.php(63): StudyMaterialsArchiveBuilder::buildMultiStudyZipFile(array("457"), "public")
58             foreach($ids as $id)
59             {
60                 UserPermissionsAndWorkflowLogicHelper::assertStudyIsDownloadableByPublic($id);
61             }
62 
63             $zipFileInfo = StudyMaterialsArchiveBuilder::buildMultiStudyZipFile($ids, CommonConstants::StudyAttachmentVisibilityPublic);  
64             $zipFileName = $zipFileInfo['name'];
65             $zipFilePath = $zipFileInfo['path'];
66 
67             $content = file_get_contents($zipFilePath);
68             @unlink($zipFilePath);  
2024-03-29 01:13:52 Apache/2.4.6 (CentOS) OpenSSL/1.0.2k-fips PHP/5.6.40 Yii Framework/1.1.13