From 3877b8549995bed49275b4291149a86939703af9 Mon Sep 17 00:00:00 2001 From: Alec Smecher Date: Wed, 2 Oct 2019 15:50:59 -0400 Subject: [PATCH] Resolve PHP warnings --- .../security/authorization/DataObjectRequiredPolicy.inc.php | 4 +++- classes/services/PKPUserService.inc.php | 2 +- classes/submission/reviewAssignment/ReviewAssignment.inc.php | 2 +- .../submission/reviewer/form/ReviewerReviewStep3Form.inc.php | 2 +- 4 files changed, 6 insertions(+), 4 deletions(-) diff --git a/classes/security/authorization/DataObjectRequiredPolicy.inc.php b/classes/security/authorization/DataObjectRequiredPolicy.inc.php index b423dff3c7c..7e434c86920 100644 --- a/classes/security/authorization/DataObjectRequiredPolicy.inc.php +++ b/classes/security/authorization/DataObjectRequiredPolicy.inc.php @@ -91,7 +91,9 @@ function dataObjectEffect() { } /** - * Identifies a submission id in the request. + * Identifies a data object id in the request. + * @param $lookOnlyByParameterName boolean True iff page router + * requests should only look for named parameters. * @return integer|false returns false if no valid submission id could be found. */ function getDataObjectId($lookOnlyByParameterName = false) { diff --git a/classes/services/PKPUserService.inc.php b/classes/services/PKPUserService.inc.php index 0190f8ae4fe..f8a8f822fee 100644 --- a/classes/services/PKPUserService.inc.php +++ b/classes/services/PKPUserService.inc.php @@ -71,7 +71,7 @@ public function getMany($args = array()) { public function getMax($args = array()) { $userListQB = $this->_getQueryBuilder($args); $countQO = $userListQB->countOnly()->get(); - $countRange = new DBResultRange($args['count'], 1); + $countRange = new DBResultRange($args['count']??null, 1); $userDao = DAORegistry::getDAO('UserDAO'); $countResult = $userDao->retrieveRange($countQO->toSql(), $countQO->getBindings(), $countRange); $countQueryResults = new DAOResultFactory($countResult, $userDao, '_returnUserFromRowWithData'); diff --git a/classes/submission/reviewAssignment/ReviewAssignment.inc.php b/classes/submission/reviewAssignment/ReviewAssignment.inc.php index cac7a6f858f..55e6eb14a26 100644 --- a/classes/submission/reviewAssignment/ReviewAssignment.inc.php +++ b/classes/submission/reviewAssignment/ReviewAssignment.inc.php @@ -653,7 +653,7 @@ function getWeeksDue() { * (Includes default '' => "Choose One" string.) * @return array recommendation => localeString */ - function getReviewerRecommendationOptions() { + static function getReviewerRecommendationOptions() { static $reviewerRecommendationOptions = array( '' => 'common.chooseOne', diff --git a/classes/submission/reviewer/form/ReviewerReviewStep3Form.inc.php b/classes/submission/reviewer/form/ReviewerReviewStep3Form.inc.php index 9a019825344..817e8402580 100644 --- a/classes/submission/reviewer/form/ReviewerReviewStep3Form.inc.php +++ b/classes/submission/reviewer/form/ReviewerReviewStep3Form.inc.php @@ -246,7 +246,7 @@ function execute() { $userDao = DAORegistry::getDAO('UserDAO'); $reviewer = $userDao->getById($reviewAssignment->getReviewerId()); - $request = Application::getRequest(); + $request = Application::get()->getRequest(); SubmissionLog::logEvent( $request, $submission,