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 ajnyga committed Nov 17, 2019
1 parent 99faff6 commit 3a56b22
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
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 @@ -67,7 +67,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 3a56b22

Please sign in to comment.