Skip to content

Commit

Permalink
pkp/pkp-lib#5122 Use Countable interface in DAOResultIterator
Browse files Browse the repository at this point in the history
  • Loading branch information
NateWr authored and asmecher committed Oct 22, 2019
1 parent 3b790e4 commit 2db7ede
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion api/v1/issues/IssueHandler.inc.php
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
2 changes: 1 addition & 1 deletion classes/components/forms/site/SiteConfigForm.inc.php
Original file line number Diff line number Diff line change
Expand Up @@ -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[] = [
Expand Down
2 changes: 1 addition & 1 deletion pages/article/ArticleHandler.inc.php
Original file line number Diff line number Diff line change
Expand Up @@ -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)) {
Expand Down

0 comments on commit 2db7ede

Please sign in to comment.