Skip empty obsolete owner when adding to own NC #25932
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
The owner field is nowadays always empty when adding a federated share
using "Add to your Nextcloud", so don't check for it.
Fixes an issue where "Add to your Nextcloud" doesn't add anything.
I could confirm that the owner is not relevant looking at this code here from the related API: https://github.com/nextcloud/server/blob/bugfix/noid/fix-fed-share-add-to-nc/apps/federatedfilesharing/lib/Controller/MountPublicLinkController.php#L184
Issue
Steps to reproduce
allow_local_remote_servers
=> true to config.php of both instancesBefore the fix
No dialog appears, nothing is mounted.
After the fix
A dialog appears and asks you to confirm that you want to mount it.
After confirming, a notification is received later on.
Accepting the notification properly mounts the share
Further information
If you check the "#remote" hash URL part you'll see that "owner" is empty.
The JS code was still expecting the owner to be set, otherwise it would ignore the request.
The fix removes that requirement.
Not sure what NC version stopped setting the owner field in the public link page ?