From 2db7edefc0ac15e6c47830a65917c05cf490f99c Mon Sep 17 00:00:00 2001 From: Nate Wright Date: Tue, 22 Oct 2019 17:53:11 +0100 Subject: [PATCH] pkp/pkp-lib#5122 Use Countable interface in DAOResultIterator --- api/v1/issues/IssueHandler.inc.php | 2 +- classes/components/forms/site/SiteConfigForm.inc.php | 2 +- pages/article/ArticleHandler.inc.php | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/api/v1/issues/IssueHandler.inc.php b/api/v1/issues/IssueHandler.inc.php index 9afe5686cac..d8a251a1a1a 100644 --- a/api/v1/issues/IssueHandler.inc.php +++ b/api/v1/issues/IssueHandler.inc.php @@ -169,7 +169,7 @@ public function getMany($slimRequest, $response, $args) { $items = array(); $result = $issueService->getMany($params); - if ($result->valid()) { + if (count($result)) { $propertyArgs = array( 'request' => $request, 'slimRequest' => $slimRequest, diff --git a/classes/components/forms/site/SiteConfigForm.inc.php b/classes/components/forms/site/SiteConfigForm.inc.php index d1786b44859..d01def59336 100644 --- a/classes/components/forms/site/SiteConfigForm.inc.php +++ b/classes/components/forms/site/SiteConfigForm.inc.php @@ -46,7 +46,7 @@ public function __construct($action, $locales, $site) { 'value' => $site->getData('title'), ])); - if ($result->valid()) { + if (count($result)) { $options = [['value' => '', 'label' => '']]; foreach ($result as $context) { $options[] = [ diff --git a/pages/article/ArticleHandler.inc.php b/pages/article/ArticleHandler.inc.php index 8005531fcf6..98bf668b015 100644 --- a/pages/article/ArticleHandler.inc.php +++ b/pages/article/ArticleHandler.inc.php @@ -70,7 +70,7 @@ function initialize($request, $args = array()) { 'publisherIds' => $urlPath, ]); $publicationWithMatchingUrl = null; - if ($result->valid()) { + if (count($result)) { $publicationWithMatchingUrl = $result->current(); $submissionId = $publicationWithMatchingUrl->getData('submissionId'); } elseif (ctype_digit($urlPath)) {