X-Git-Url: https://vcs.fsf.org/?a=blobdiff_plain;f=CRM%2FUtils%2FWeight.php;h=d514351845db8efdee7fae25b8e9f41ab4379158;hb=1e1ed556e29f820a3834d8b1d45e979bca8c720f;hp=c5d01a65984dd79770a5fe473896eb4e6e677abf;hpb=9ba048ee548673f91769cd83173c9ffe37b5ef40;p=civicrm-core.git diff --git a/CRM/Utils/Weight.php b/CRM/Utils/Weight.php index c5d01a6598..d514351845 100644 --- a/CRM/Utils/Weight.php +++ b/CRM/Utils/Weight.php @@ -3,7 +3,7 @@ +--------------------------------------------------------------------+ | CiviCRM version 4.7 | +--------------------------------------------------------------------+ - | Copyright CiviCRM LLC (c) 2004-2015 | + | Copyright CiviCRM LLC (c) 2004-2017 | +--------------------------------------------------------------------+ | This file is a part of CiviCRM. | | | @@ -53,7 +53,7 @@ class CRM_Utils_Weight { */ public static function correctDuplicateWeights($daoName, $fieldValues = NULL, $weightField = 'weight') { $selectField = "MIN(id) AS dupeId, count(id) as dupeCount, $weightField as dupeWeight"; - $groupBy = "$weightField having dupeCount>1"; + $groupBy = "$weightField having count(id)>1"; $minDupeID = CRM_Utils_Weight::query('SELECT', $daoName, $fieldValues, $selectField, NULL, NULL, $groupBy); @@ -434,7 +434,7 @@ class CRM_Utils_Weight { } public static function fixOrder() { - $signature = CRM_Utils_Request::retrieve('_sgn', 'String', CRM_Core_DAO::$_nullObject); + $signature = CRM_Utils_Request::retrieve('_sgn', 'String'); $signer = new CRM_Utils_Signer(CRM_Core_Key::privateKey(), self::$SIGNABLE_FIELDS); // Validate $_GET values b/c subsequent code reads $_GET (via CRM_Utils_Request::retrieve) @@ -443,14 +443,14 @@ class CRM_Utils_Weight { } // Note: Ensure this list matches self::$SIGNABLE_FIELDS - $daoName = CRM_Utils_Request::retrieve('dao', 'String', CRM_Core_DAO::$_nullObject); - $id = CRM_Utils_Request::retrieve('id', 'Integer', CRM_Core_DAO::$_nullObject); - $idName = CRM_Utils_Request::retrieve('idName', 'String', CRM_Core_DAO::$_nullObject); - $url = CRM_Utils_Request::retrieve('url', 'String', CRM_Core_DAO::$_nullObject); - $filter = CRM_Utils_Request::retrieve('filter', 'String', CRM_Core_DAO::$_nullObject); - $src = CRM_Utils_Request::retrieve('src', 'Integer', CRM_Core_DAO::$_nullObject); - $dst = CRM_Utils_Request::retrieve('dst', 'Integer', CRM_Core_DAO::$_nullObject); - $dir = CRM_Utils_Request::retrieve('dir', 'String', CRM_Core_DAO::$_nullObject); + $daoName = CRM_Utils_Request::retrieve('dao', 'String'); + $id = CRM_Utils_Request::retrieve('id', 'Integer'); + $idName = CRM_Utils_Request::retrieve('idName', 'String'); + $url = CRM_Utils_Request::retrieve('url', 'String'); + $filter = CRM_Utils_Request::retrieve('filter', 'String'); + $src = CRM_Utils_Request::retrieve('src', 'Integer'); + $dst = CRM_Utils_Request::retrieve('dst', 'Integer'); + $dir = CRM_Utils_Request::retrieve('dir', 'String'); $object = new $daoName(); $srcWeight = CRM_Core_DAO::getFieldValue($daoName, $src, 'weight', $idName); $dstWeight = CRM_Core_DAO::getFieldValue($daoName, $dst, 'weight', $idName);