diff --git a/includes/runtime/Viewer.php b/includes/runtime/Viewer.php
index a6148bcc69f3e079adb7f7504a9506b0b98a9e81..201b97ca28bd274d971fee330ef525d0b771c793 100644
--- a/includes/runtime/Viewer.php
+++ b/includes/runtime/Viewer.php
@@ -90,7 +90,7 @@ class Vtiger_Viewer extends Smarty {
 			'array_map', 'array_key_exists', 'get_class', 'vtlib_array', 'getDuplicatesPreventionMessage', 'htmlentities', 'purifyHtmlEventAttributes',
 			'getCurrencySymbolandCRate', 'mb_substr', 'isPermitted', 'getEntityName', 'function_exists', 'php7_trim', 'php7_htmlentities',
 			'strtolower', 'strtoupper', 'str_replace', 'urlencode', 'getTranslatedCurrencyString', 'getTranslatedString', 'is_object', 'is_numeric',
-			'php7_sizeof', 'method_exists','implode','mt_rand');
+			'php7_sizeof', 'method_exists','implode','mt_rand','substr','in_array');
 		foreach ($modifiers as $modifier) {
 			if (function_exists($modifier)) {
 				$this->registerPlugin('modifier', $modifier, $modifier);
diff --git a/modules/Settings/SharingAccess/models/Rule.php b/modules/Settings/SharingAccess/models/Rule.php
index f63bf3fa000e670bbce1457ef91455439371e119..744c274500bf438bfc31d1182a1a23db9a4b6ee3 100644
--- a/modules/Settings/SharingAccess/models/Rule.php
+++ b/modules/Settings/SharingAccess/models/Rule.php
@@ -121,7 +121,7 @@ class Settings_SharingAccess_Rule_Model extends Vtiger_Base_Model {
 	}
 
 	protected function getRuleComponents() {
-		if(!$this->rule_details && $this->getId()) {
+		if(!property_exists($this,'rule_details') ||!$this->rule_details && $this->getId()) {
 			$db = PearDatabase::getInstance();
 
 			$relationTypeComponents = explode('::', $this->get('relationtype'));