Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can't add shared photos to an album (Can't add file to album, only files from USER can be added) #2095

Open
jakobroehrl opened this issue Oct 17, 2023 · 18 comments
Labels
0. Needs triage Pending approval or rejection. This issue is pending approval. bug Something isn't working feature: albums Related to the albums section

Comments

@jakobroehrl
Copy link
Contributor

I share a lot of pics with my wife.
I can add all of them to an album, but she can not:
"Failed to add xyz.jpg to album own."

object { app: "photos", uid: "verena", level: "2", error: Error }
​app: "photos"
​error: Error: Invalid response: 403
​​columnNumber: 1641624
​​fileName: "https://server/apps/photos/js/photos-main.js?v=a4ddf491-16"
​​lineNumber: 2
​​message: "Invalid response: 403 "
​​
response: Object { data: <?xml version="1.0" encoding="utf-8"?>\n<d:error xmlns:d="DAV:" xmlns:s="http://sabredav.org/ns">\n <s:exception>Sabre\\DAV\\Exception\\Forbidden</s:exception>\n <s:message>Can't add file to album, only files from user can be added</s:message>\n</d:error>\n, status: 403, statusText: "", … }

@jakobroehrl jakobroehrl added bug Something isn't working 0. Needs triage Pending approval or rejection. This issue is pending approval. labels Oct 17, 2023
@jsobiecki
Copy link

I can confirm issue reported by @jakobroehrl on m end. I received identical output when tried to add shared file to album. I'm using Photos 2.3.0 and Nextcloud version 27.1.2.

@AxelTheGerman
Copy link

Same here, just took Photos for a spin and unable to add most of my (i.e. shared with me) pictures even though it's also a collaborative album with the same user who owns the pictures

@StormOli
Copy link

Can confirm this issue still exists in Photos 2.3.0 and Nextcloud 27.1.3

@jakobroehrl
Copy link
Contributor Author

Still with NC 28 there:
DAV COPY error: 403 (Forbidden)

@derDings81
Copy link

I lately also ran into this problem. Users can only add their own files to albums.

It would really be great if this could be fixed or at least a workaround and better error handling could be implemented. :-)

@ubrfkr
Copy link

ubrfkr commented Jan 4, 2024

I also have this problem. Does anyone know of a work-around? I had a look at the source-code but couldn't orientate myself to find an easy solution.

@alishayei
Copy link

No updates?

@lgdumlao
Copy link

Same problem on Nextcloud 27.1.8, Photos 2.3.0 and Memories 7.2.0. This is still the case even if I am given edit authorization on the shared folder.

@dhzl84
Copy link

dhzl84 commented Apr 19, 2024

Still not working on Nextcloud 28.0.4, Photos 2.4.0 and Memories 7.2.0

@helmo
Copy link

helmo commented Apr 26, 2024

I'm also ran into this.

I found the code that generates this error in https://github.com/nextcloud/photos/blob/master/lib/Sabre/Album/AlbumRoot.php#L167

When I comment just that line "it works for me".... but that's a very limited testcase. I think we need to add a condition there that checks access when the uid does not match.

@tmlmt
Copy link

tmlmt commented May 23, 2024

I confirm this error, which also affects pulsejet/memories which depends on nextcloud/photos

When adding a photo owned by another user but shared with me, the following error appears in the log:

Application: webdav
Message: Forbidden Can't add file to album, only files from myuser can be added

Which actually comes from line 152 in this extract:

$ownerUID = $sourceNode->getFileInfo()->getOwner()->getUID();
$uid = $this->userId;
if ($ownerUID !== $uid) {
throw new Forbidden("Can't add file to album, only files from $uid can be added");
}

Obviously, the check is incomplete, it should also be authorized to add a photo which is shared to us.

Replacing the above lines 151 to 153 by the following does the trick (as well as of course disabling this check entirely):

                if ($ownerUID !== $uid && !$this->albumMapper->isCollaborator($this->album->getAlbum()->getId(), $ownerUID)) {
                        throw new Forbidden("Can't add photo to album, only photos from $uid can be added unless the album is shared with the owner of the photo ($ownerUID)");
                }

My photo gets added but I get a number of weird things:

  • Previews have trouble being displayed. I need to refresh the page for them to appear. And I get an error in the log saying that some folder "appdata_xxxxxxxx/preview/a/b/1/2/3" couldn't get created. But it was created and the preview is generated is seems ...
  • the photo gets copied to the root of my Photos folder: is this the expected behavior?
  • I get another error message saying "Failed to add myphoto.jpg to collection photos/myuser/albums/myalbumname" in the UI and a "Webdav / Not found: myphoto.jpg" in the log. This comes from the following line:
    logger.error(t('photos', 'Failed to add {fileBaseName} to collection {collectionFileName}.', { fileBaseName: file.basename, collectionFileName }), { error })
    Why this error? I don't even see a folder called photos/myuser/albums in my data?

All in all, why so many webdav operations and copying files around to handle albums? It sounds a bit messy

@PeggyFree
Copy link

Hello,

As described here and in this Nextcloud topic, this limitation is truly disappointing as group photos are usually stored in a shared folder, when doing so it is no longer possible to create photo albums. For this reason, today in 2024 I still use the old file view to browse and create basic shared links instead of benefiting from Memories capabilities.

@LukeRhok
Copy link

LukeRhok commented Jul 3, 2024

I absolutely agree! My wife and I are trying to collaborate on an album to share out with the rest of the family. Except she cannot add anything to the album because we pool together our pictures in a folder that I just share directly to her for her easy access.
Seeing this limitation is extremely disappointing. I don't understand why Nextcloud has little quirks like this that breaks an otherwise good experience with the platform.

@dab0u

This comment was marked as duplicate.

@joshtrichards joshtrichards added the feature: albums Related to the albums section label Aug 5, 2024
@joshtrichards joshtrichards changed the title Can't add shared photos to an album Can't add shared photos to an album (Can't add file to album, only files from USER can be added) Aug 5, 2024
@001101111011101101
Copy link

Same here.

Setup:

  • i sync my photos from my photo to my nextcloud, onto a folder on a mounted SMB Share
  • i share the SMB folder via nextcloud with another user
  • i create an Album in Memories, for example to collect photos for a montage and share that Album
  • the other user can see those photos in their Memories app and see the shared Album
  • BUT the other user cannot add to the Album

[webdav] Debug: Can't add file to album, only files from USER can be added
COPY /remote.php/dav/files/USER/Shared/Photos/2024/08/NAME.heic
from IP by USER at 11.08.2024, 09:45:17

@tmlmt
Copy link

tmlmt commented Aug 11, 2024

Nextcloud is just not built to be a photo management system (creating albums, sharing albums, etc.). That part would need to be completely rewritten to be robust and feature-full. I would recommend carving that part out and using a dedicated solution such as Immich.

@wtangofoxtrot
Copy link

very annoying bug, only I as the admin can seem to create albums.

@jwrth
Copy link

jwrth commented Dec 17, 2024

For me using the group folders app was the solution. You can create a group folder for a specific group, give them the needed permissions and store all the photos within this group folder. Then everyone is allowed to add the photos to a memories album.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
0. Needs triage Pending approval or rejection. This issue is pending approval. bug Something isn't working feature: albums Related to the albums section
Projects
None yet
Development

No branches or pull requests