From e6579d8085aaba104501c573dfd82ceededa7e05 Mon Sep 17 00:00:00 2001 From: Julian Egelstaff Date: Fri, 28 Feb 2025 22:26:26 -0500 Subject: [PATCH] Fix for notices related to issue #622 --- modules/formulize/class/elements.php | 6 +++++- modules/formulize/class/textElement.php | 6 +++++- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/modules/formulize/class/elements.php b/modules/formulize/class/elements.php index ad9bcafe4..d937a26b6 100755 --- a/modules/formulize/class/elements.php +++ b/modules/formulize/class/elements.php @@ -192,7 +192,11 @@ public function getVar($key, $format = 's') { OR $ele_type == 'textarea') AND is_array($value)) { $filename = $ele_type.'_'.$this->getVar('ele_handle').'.php'; - $fileValue = strval(file_get_contents(XOOPS_ROOT_PATH.'/modules/formulize/code/'.$filename)); + $filePath = XOOPS_ROOT_PATH.'/modules/formulize/code/'.$filename; + $fileValue = ""; + if(file_exists($filePath)) { + $fileValue = strval(file_get_contents($filePath)); + } $value[0] = $fileValue ? $fileValue : $value[0]; } } diff --git a/modules/formulize/class/textElement.php b/modules/formulize/class/textElement.php index 56037852e..bde4d96fd 100644 --- a/modules/formulize/class/textElement.php +++ b/modules/formulize/class/textElement.php @@ -67,7 +67,11 @@ public function getVar($key, $format = 's') { $value = parent::getVar($key, $format); if($key == 'ele_value' AND is_array($value)) { $filename ='text_'.$this->getVar('ele_handle').'.php'; - $fileValue = strval(file_get_contents(XOOPS_ROOT_PATH.'/modules/formulize/code/'.$filename)); + $filePath = XOOPS_ROOT_PATH.'/modules/formulize/code/'.$filename; + $fileValue = ""; + if(file_exists($filePath)) { + $fileValue = strval(file_get_contents($filePath)); + } $value[2] = $fileValue ? $fileValue : $value[2]; } return $value;