diff --git a/include/utils/ConfigReader.php b/include/utils/ConfigReader.php index f97dcbdc97a078178924ca9c13412149debc76a9..efb99edc0512cf3224567c52d95c3b81fb6ecd53 100644 --- a/include/utils/ConfigReader.php +++ b/include/utils/ConfigReader.php @@ -24,7 +24,7 @@ class ConfigReader { function load($path, $name, $force = false) { $this->name = $path; - if(!$force && isset(self::$propertiesCache) && self::$propertiesCache[$path]) { + if(!$force && isset(self::$propertiesCache) && isset(self::$propertiesCache[$path]) && self::$propertiesCache[$path]) { $this->properties = self::$propertiesCache[$path]; return; } @@ -46,4 +46,4 @@ class ConfigReader { } } -?> \ No newline at end of file +?> diff --git a/include/utils/utils.php b/include/utils/utils.php index e3272830b6a573d6931f8eb479e517f3773c649e..bd5b5daddaa61d7ce0c3f665da22220fbb105a64 100755 --- a/include/utils/utils.php +++ b/include/utils/utils.php @@ -2022,9 +2022,9 @@ function getCurrencyDecimalPlaces($user = null) { global $current_user; $currency_decimal_places = 2; - if (!empty($user)) { + if (!empty($user) && isset($user->no_of_currency_decimals)) { $currency_decimal_places = $user->no_of_currency_decimals; - } else if ($current_user) { + } else if ($current_user && isset($current_user->no_of_currency_decimals)) { $currency_decimal_places = $current_user->no_of_currency_decimals; } return (int)$currency_decimal_places; diff --git a/modules/Migration/schema/600_to_610.php b/modules/Migration/schema/600_to_610.php index 72cc56cf0699ff1599d4d02610df4b0caa6cf14f..1456d03f308b0a403e4761194c9d5883189a6d10 100644 --- a/modules/Migration/schema/600_to_610.php +++ b/modules/Migration/schema/600_to_610.php @@ -116,7 +116,7 @@ $unWanted=array( "modules/FieldFormulas/functional.js" ); -for($i=0, $len=php7_count($unWanted);$i<=$len;$i++){ +for($i=0, $len=php7_count($unWanted);$i<$len;$i++){ if(file_exists($unWanted[$i])){ unlink($unWanted[$i]); } @@ -1551,4 +1551,4 @@ Migration_Index_View::ExecuteQuery("CREATE TABLE IF NOT EXISTS vtiger_reporttype //Configuration Editor fix $sql = "UPDATE vtiger_settings_field SET name = ? WHERE name = ?"; -Migration_Index_View::ExecuteQuery($sql,array('LBL_CONFIG_EDITOR', 'Configuration Editor')); \ No newline at end of file +Migration_Index_View::ExecuteQuery($sql,array('LBL_CONFIG_EDITOR', 'Configuration Editor')); diff --git a/modules/Migration/views/Index.php b/modules/Migration/views/Index.php index dade9e2aca31622dbfd7a7dc2047c603fa28b00d..1170148e134a8739fa4aad039999cc6728a959d4 100644 --- a/modules/Migration/views/Index.php +++ b/modules/Migration/views/Index.php @@ -233,7 +233,7 @@ class Migration_Index_View extends Vtiger_View_Controller { $fieldName = '('. $fieldName .')'; } - $groupId = $condition['groupid']; + $groupId = isset($condition['groupid']) ? $condition['groupid'] : null; if (!$groupId) { $groupId = 0; } diff --git a/modules/Settings/Vtiger/models/ConfigModule.php b/modules/Settings/Vtiger/models/ConfigModule.php index 47ea1dacef4b2e69944ca5b51190f5cd1717f2c3..26d3f2d22c31c9d206e62b247b077bf14b67aeac 100644 --- a/modules/Settings/Vtiger/models/ConfigModule.php +++ b/modules/Settings/Vtiger/models/ConfigModule.php @@ -75,6 +75,7 @@ class Settings_Vtiger_ConfigModule_Model extends Settings_Vtiger_Module_Model { $fieldValue = explode(' = ', $configContent); $fieldValue = $fieldValue[1]; if ($fieldName === 'upload_maxsize') { + $fieldValue = trim($fieldValue, ' ;'); $fieldValue = round(number_format($fieldValue / 1048576, 2)); } @@ -168,4 +169,4 @@ class Settings_Vtiger_ConfigModule_Model extends Settings_Vtiger_Module_Model { $moduleModel->getViewableData(); return $moduleModel; } -} \ No newline at end of file +} diff --git a/modules/Vtiger/models/MenuStructure.php b/modules/Vtiger/models/MenuStructure.php index fb05add1a0d6b06c2ef145ce8ee8a51fe355b96a..c0d111dcde91ba9387198b11cee030cc7a5a3481 100644 --- a/modules/Vtiger/models/MenuStructure.php +++ b/modules/Vtiger/models/MenuStructure.php @@ -202,7 +202,7 @@ class Vtiger_MenuStructure_Model extends Vtiger_Base_Model { $regroupMenuByParent[$app][$moduleName] = $moduleModel; } } else { - if(!in_array($moduleName, $ignoredModules)) { + if(!in_array($moduleName, $ignoredModules) && isset($oldToNewAppMap[$appName])) { $app = $oldToNewAppMap[$appName]; $regroupMenuByParent[$app][$moduleName] = $moduleModel; } diff --git a/modules/com_vtiger_workflow/VTTaskManager.inc b/modules/com_vtiger_workflow/VTTaskManager.inc index 11630a23caf76f560ffa518d9a890853dad97fc9..8f7058f73fdedde294375615936eb4a1dc4a038f 100644 --- a/modules/com_vtiger_workflow/VTTaskManager.inc +++ b/modules/com_vtiger_workflow/VTTaskManager.inc @@ -28,7 +28,7 @@ */ public function saveTask($task){ $adb = $this->adb; - if(is_numeric($task->id)){//How do I check whether a member exists in php? + if(isset($task->id) && is_numeric($task->id)){ $taskId = $task->id; $adb->pquery("update com_vtiger_workflowtasks set summary=?, task=? where task_id=?", array($task->summary, serialize($task), $taskId)); diff --git a/pkg/vtiger/modules/CustomerPortal/settings/models/Module.php b/pkg/vtiger/modules/CustomerPortal/settings/models/Module.php index 45c422047a1ae2811ea73a08a7daf566c0d6f719..cf3d4f21c9fca990c68e95c59f27add26889f9ee 100644 --- a/pkg/vtiger/modules/CustomerPortal/settings/models/Module.php +++ b/pkg/vtiger/modules/CustomerPortal/settings/models/Module.php @@ -12,6 +12,7 @@ class Settings_CustomerPortal_Module_Model extends Settings_Vtiger_Module_Model var $name = 'CustomerPortal'; var $max_sequence = ''; + var $portalModules = null; /** * Function to get Current portal user diff --git a/pkg/vtiger/modules/ModTracker/modules/ModTracker/ModTracker.php b/pkg/vtiger/modules/ModTracker/modules/ModTracker/ModTracker.php index 49e4b647c92d2a62b2390dad06a5e058e53bfca2..764835a3c4057580cfa6bb9ce7e2d0fe1caa115d 100644 --- a/pkg/vtiger/modules/ModTracker/modules/ModTracker/ModTracker.php +++ b/pkg/vtiger/modules/ModTracker/modules/ModTracker/ModTracker.php @@ -82,7 +82,8 @@ class ModTracker { * function gives an array of module names for which modtracking is enabled */ function getModTrackerEnabledModules() { - global $adb; + global $adb; + $modules = array(); $moduleResult = $adb->pquery('SELECT * FROM vtiger_modtracker_tabs', array()); for($i=0; $i<$adb->num_rows($moduleResult); $i++) { $tabId = $adb->query_result($moduleResult, $i, 'tabid'); @@ -395,4 +396,4 @@ class ModTracker { self::trackRelation($sourceModule, $sourceId, $targetModule, $targetId, self::$UNLINK); } } -?> \ No newline at end of file +?> diff --git a/vtlib/Vtiger/Functions.php b/vtlib/Vtiger/Functions.php index e8690dce77e425793f928dd4be9d224106466d48..b4ffe79ff88376b5ac5a64765589b24ccb3a5ad3 100644 --- a/vtlib/Vtiger/Functions.php +++ b/vtlib/Vtiger/Functions.php @@ -164,7 +164,13 @@ class Vtiger_Functions { self::$moduleNameIdCache[$row['name']] = $row; } } - return $id ? self::$moduleIdNameCache[$id] : self::$moduleNameIdCache[$name]; + if ($id && isset(self::$moduleIdNameCache[$id])) { + return self::$moduleIdNameCache[$id]; + } + if ($name && isset(self::$moduleNameIdCache[$name])) { + return self::$moduleNameIdCache[$name]; + } + return null; } static function getModuleData($mixed) { diff --git a/vtlib/Vtiger/PackageUpdate.php b/vtlib/Vtiger/PackageUpdate.php index a858705d13186cc6d55c1a357f2af9f0ee5c00eb..f03cda8ea690e0ba1754d92d0f153df2800674e2 100644 --- a/vtlib/Vtiger/PackageUpdate.php +++ b/vtlib/Vtiger/PackageUpdate.php @@ -16,6 +16,7 @@ include_once('vtlib/Vtiger/PackageImport.php'); class Vtiger_PackageUpdate extends Vtiger_PackageImport { var $_migrationinfo = false; + var $_migrations = false; /** * Constructor diff --git a/vtlib/thirdparty/dUnzip2.inc.php b/vtlib/thirdparty/dUnzip2.inc.php index 893947dae0d7251c342599b0701a5274ff04836c..24b3ab1f66bef9e1119a167bb80578a900ad8407 100644 --- a/vtlib/thirdparty/dUnzip2.inc.php +++ b/vtlib/thirdparty/dUnzip2.inc.php @@ -224,8 +224,10 @@ class dUnzip2{ $fdetails['uncompressed_size'], $targetFileName ); - if($applyChmod && $targetFileName) + if($applyChmod && $targetFileName) { + // TODO: check if this warning supression if its not working. @chmod($targetFileName, $applyChmod == 0755? 0644 : $applyChmod); + } return $ret; } diff --git a/vtlib/thirdparty/network/Request.php b/vtlib/thirdparty/network/Request.php index 8d1ee22a41e4aaaa339ee725e7775ee1da5888f2..193b6e345d2fcc868e2112a78a502d37186ed62e 100644 --- a/vtlib/thirdparty/network/Request.php +++ b/vtlib/thirdparty/network/Request.php @@ -965,9 +965,7 @@ class HTTP_Request // "normal" POST request if (!isset($boundary)) { - $callback = function_exists('create_function')? - create_function('$a', 'return $a[0] . \'=\' . $a[1];') : - function ($a) { return $a[0] .'='. $a[1]; }; + $callback = function ($a) { return $a[0] .'='. $a[1]; }; $postdata = implode('&', array_map($callback, $this->_flattenArray('', $this->_postData)));