nextcloud / nextcloud/guests

Guests cannot create public links

Open Beginner friendly
#1,521 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

0. Needs triage bug
Dominant language
JavaScript
Stars
61
Forks
34
Avg merge
3d 19h
Merged PRs (30d)
22

Description

How to use GitHub
  • Please use the 👍 reaction to show that you are affected by the same issue.
  • Please don't comment if you have no relevant information to add. It's just extra noise for everyone subscribed to this issue.
  • Subscribe to receive notifications on status change and new comments.

Steps to reproduce
  1. Login as guest
  2. Open the share dialog
  3. Create a public link
Expected behaviour

A link should be created

Actual behaviour

Error: OCA\Guests\Service\InviteService::sendInvite(): Argument #2 ($guest) must be of type string, null given

The fix is rather simple. In Hooks.php change:

$shareWith = $share->getSharedWith();
$isGuest = $this->guestManager->isGuest($shareWith);

to:

$shareWith = $share->getSharedWith();
if ($shareWith === null) {
return;
}
$isGuest = $this->guestManager->isGuest($shareWith);

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start in Hooks.php and reproduce the issue by logging in as a guest, opening the share dialog, and creating a public link. Inspect the handling of getSharedWith() before the guest invitation call, then verify that public links are created without the null-argument error.

Written by the indexing model from the issue text.

Assessment

Tech stack
php
Domain
backend
Issue type
Bug
Difficulty
1/5
Estimated time
1-3 hours
Activity status
Quiet
Clarity
Clearly specified
Newbie friendliness
85/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.