Skip to content

fix(#633): handle invalid UUIDs in found_by parameter#634

Merged
deg-pl merged 2 commits intoopencaching:masterfrom
stefopl:okapi-633
Dec 10, 2024
Merged

fix(#633): handle invalid UUIDs in found_by parameter#634
deg-pl merged 2 commits intoopencaching:masterfrom
stefopl:okapi-633

Conversation

@stefopl
Copy link
Copy Markdown

@stefopl stefopl commented Nov 21, 2024

No description provided.

Copy link
Copy Markdown
Member

@wrygiel wrygiel left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the fix! This looks good to me (apart from some details mentioned in the review). However, I no longer actively maintain OKAPI, so I suggest you wait at least one day before merging (perhaps there are other, more active reviewers who'd want to chip in).

try {
$users = OkapiServiceRunner::call("services/users/users", new OkapiInternalRequest(
$this->request->consumer, null, array('user_uuids' => $tmp, 'fields' => 'internal_id')));
if (empty($users) || !is_array($users)) {
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should be outside (below) the surrounding try..catch.

"The following UUID(s) are invalid or not found: " . implode(", ", $invalid_uuids)
);
}

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Indent with spaces (match the existing indentation).

@stefopl
Copy link
Copy Markdown
Author

stefopl commented Nov 21, 2024

It would be best if the fix waited for merging at least until Monday.
And if someone without a development environment would like to check, they can go to ocpl .stefo .pl/ okapi/

@deg-pl deg-pl merged commit 3aab571 into opencaching:master Dec 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants