From bbd5388fc06bcda073e7e75a9eb86651166cc7f9 Mon Sep 17 00:00:00 2001
From: prasad <prasad@vtiger.com>
Date: Mon, 6 May 2024 11:04:21 +0530
Subject: [PATCH] E_ALL - AllowDynamicProperties, php 8.2 conventions

---
 modules/Users/models/Record.php                               | 3 ++-
 modules/Vtiger/models/MenuStructure.php                       | 2 +-
 modules/com_vtiger_workflow/VTEntityCache.inc                 | 3 +++
 modules/com_vtiger_workflow/VTEntityMethodManager.inc         | 1 +
 modules/com_vtiger_workflow/VTEventHandler.inc                | 1 +
 .../modules/ExtensionStore/settings/connectors/ExtnStore.php  | 2 +-
 .../modules/ExtensionStore/settings/models/Extension.php      | 4 ++--
 7 files changed, 11 insertions(+), 5 deletions(-)

diff --git a/modules/Users/models/Record.php b/modules/Users/models/Record.php
index 6f97b8683..1cc0d3633 100644
--- a/modules/Users/models/Record.php
+++ b/modules/Users/models/Record.php
@@ -398,7 +398,8 @@ class Users_Record_Model extends Vtiger_Record_Model {
             $url = \Vtiger_Functions::getFilePublicURL($imageId, $imageName);
 
 			//decode_html - added to handle UTF-8 characters in file names
-			$imageOriginalName = urlencode(decode_html($imageName));
+			$imageNameDecoded =decode_html($imageName);
+			$imageOriginalName = urlencode($imageNameDecoded ? $imageNameDecoded : "");
             if($url) {
                 $url = $site_URL.$url;
             }
diff --git a/modules/Vtiger/models/MenuStructure.php b/modules/Vtiger/models/MenuStructure.php
index c0d111dcd..7c1fb8639 100644
--- a/modules/Vtiger/models/MenuStructure.php
+++ b/modules/Vtiger/models/MenuStructure.php
@@ -87,7 +87,7 @@ class Vtiger_MenuStructure_Model extends Vtiger_Base_Model {
 				$currentTopMenuCount++;
 			}
 
-			$parent = ucfirst(strtolower($menuModel->get('parent')));
+			$parent = ucfirst(strtolower($menuModel->get('parent') ? $menuModel->get('parent') : ""));
 			if($parent == 'Sales' || $parent == 'Marketing'){
 				$parent = 'MARKETING_AND_SALES';
 			}
diff --git a/modules/com_vtiger_workflow/VTEntityCache.inc b/modules/com_vtiger_workflow/VTEntityCache.inc
index fedab9844..15d24c6e9 100644
--- a/modules/com_vtiger_workflow/VTEntityCache.inc
+++ b/modules/com_vtiger_workflow/VTEntityCache.inc
@@ -120,6 +120,9 @@ class VTWorkflowEntity{
 }
 
 class VTEntityCache{
+	var $user;
+	var $cache;
+	
 	function __construct($user){
 		$this->user = $user;
 		$this->cache = array();
diff --git a/modules/com_vtiger_workflow/VTEntityMethodManager.inc b/modules/com_vtiger_workflow/VTEntityMethodManager.inc
index acede1790..281c75d71 100644
--- a/modules/com_vtiger_workflow/VTEntityMethodManager.inc
+++ b/modules/com_vtiger_workflow/VTEntityMethodManager.inc
@@ -9,6 +9,7 @@
  ******************************************************************************/
 require_once("include/events/SqlResultIterator.inc");
 class VTEntityMethodManager{
+	var $adb;
 	
 	function __construct($adb){
 		$this->adb = $adb;
diff --git a/modules/com_vtiger_workflow/VTEventHandler.inc b/modules/com_vtiger_workflow/VTEventHandler.inc
index 4bcdbfa7f..4c251407a 100644
--- a/modules/com_vtiger_workflow/VTEventHandler.inc
+++ b/modules/com_vtiger_workflow/VTEventHandler.inc
@@ -31,6 +31,7 @@ require_once('VTWorkflowUtils.php');
  */
 
 class VTWorkflowEventHandler extends VTEventHandler {
+	var $workflows;
 
 	/**
 	 * Push tasks to the task queue if the conditions are true
diff --git a/pkg/vtiger/modules/ExtensionStore/settings/connectors/ExtnStore.php b/pkg/vtiger/modules/ExtensionStore/settings/connectors/ExtnStore.php
index 4aa3ae89c..11b2bc284 100644
--- a/pkg/vtiger/modules/ExtensionStore/settings/connectors/ExtnStore.php
+++ b/pkg/vtiger/modules/ExtensionStore/settings/connectors/ExtnStore.php
@@ -163,7 +163,7 @@ class Settings_ExtensionStore_ExtnStore_Connector {
 	/**
 	 * Function to get max created on for promotions
 	 */
-	public function getMaxCreatedOn($type = 'Extension', $function, $field) {
+	public function getMaxCreatedOn($type = 'Extension', $function = null, $field = null) {
 		$q = array('type' => $type);
 		try {
 			$response = $this->api('/app/listings', 'GET', $q ? array('q' => Zend_Json::encode($q), 'fn' => $function, 'max' => $field) : null, false);
diff --git a/pkg/vtiger/modules/ExtensionStore/settings/models/Extension.php b/pkg/vtiger/modules/ExtensionStore/settings/models/Extension.php
index b7ac2319d..7b1e4dfec 100644
--- a/pkg/vtiger/modules/ExtensionStore/settings/models/Extension.php
+++ b/pkg/vtiger/modules/ExtensionStore/settings/models/Extension.php
@@ -204,7 +204,7 @@ class Settings_ExtensionStore_Extension_Model extends Vtiger_Base_Model {
 	/**
 	 * Function to get max created on promotion
 	 */
-	public function getMaxCreatedOn($type = 'Extension', $function, $field) {
+	public function getMaxCreatedOn($type = 'Extension', $function = null, $field = null) {
 		$connector = $this->getConnector();
 		if ($connector) {
 			$listings = $connector->getMaxCreatedOn($type, $function, $field);
@@ -297,7 +297,7 @@ class Settings_ExtensionStore_Extension_Model extends Vtiger_Base_Model {
 	 * @param <String> search term
 	 * @return <Array> list of extensions <Settings_ExtensionStore_Extension_Model>
 	 */
-	public function findListings($searchTerm = null, $searchType) {
+	public function findListings($searchTerm = null, $searchType = null) {
 		$extensionModelsList = array();
 		$connector = $this->getConnector();
 		if ($connector) {
-- 
GitLab