Skip to content

Shared pics folder do not appear if shared from subfolder #6496

Closed

Description

@githubrsys

Expected behaviour

  • Show images of a shared folder within "shared from" section at the share-recieving user pictures app

Actual behaviour

  • Works if the folder is in root
  • Shows the folder as "shared" in Own folder section - which is wrong. This should not happen. But also shows the right folder in the "shared from" section.
  • Works not if the shared folder is within a subfolder. It makes no difference if any of the folder paths contain entities. The "shared from" section appears but remains empty.

Steps to reproduce

  • dunno if so. On my server it is.

Server configuration

  • /php -v
    PHP 5.4.23 (cli) (built: Dec 17 2013 05:57:16)
    Copyright (c) 1997-2013 The PHP Group
    Zend Engine v2.4.0, Copyright (c) 1998-2013 Zend Technologies
    with the ionCube PHP Loader v4.2.2, Copyright (c) 2002-2012, by ionCube Ltd.
  • mysql 5.5
  • OC Server 6.0.0a

Client configuration

  • 1.5.0 from 58035a Linux on Gnome3

Logs

  • not

@PVince81 as you can see the pics sharing is not as smooth as thought.

Activity

  1. PVince81 commented on Dec 19, 2013

    @PVince81
    Contributor

    Steps to reproduce:

    1. Create two users "user1" and "user2"
    2. Login as "user1"
    3. Create a directory "basedir"
    4. Navigate into "basedir"
    5. Create a subdir "pics"
    6. Navigate into "pics"
    7. Upload pictures
    8. Go back to "basedir"
    9. Share "pics" with "user2" and leave the permissions as is
    10. Login as "user2"
    11. Click on the "Pictures" app

    No pictures appear, hourglass cursor stays.

    The thumbnail call returns 404 in the network console.

    owncloud log:
    {"app":"files_sharing","message":"File source not found for: /basedir/pics/Vincent1-1-1.png","level":3,"time":"2013-12-19T10:42:32+00:00"}

    @schiesbn can you have a look ?

  2. PVince81 commented on Dec 19, 2013

    @PVince81
    Contributor

    It seems that it's trying to get the source file using the source file...
    Normally it would try and get the source file for "/Shared/pics/Vincent1-1-1.png" and resolve it to "/basedir/pics/Vincent-1-1-1.png" but for some reason it tries to re-resolve that one ?

  3. caco3 commented on Dec 23, 2013

    @caco3

    I can confirm this issue, see also owncloud-archive/apps#1334
    It only works as expected, if the image is in the root folder.

    OC Log shows this:
    Error files_sharing File source not found for: /Sync/Photos/xxx
    Debug OC\Files\Cache\Scanner !!! Path 'Sync/Photos/xxx' is not readable !!!
    [...]

  4. ghost assigned on Jan 8, 2014
  5. PVince81 commented on Jan 8, 2014

    @PVince81
    Contributor

    Looks like the method searchWithWhere() in apps/files_sharing/lib/cache.php is returning the wrong path for files found in subdirs of shared paths.

    In the case mentionned above, instead of returning /pics it returns the path with the base dir as /basedir/pics which breaks the preview generation / image display later. This might potentially break other apps as well...

  6. PVince81 commented on Jan 8, 2014

    @PVince81
    Contributor

    Not only does it not return the correct path, but also it doesn't explore sub-sub-...-folders when searching for images.

    I tried to fix it using another approach but it doesn't work, seems this part (search by mime type in share files/folders) needs to be completely rewritten. 😦

  7. PVince81 commented on Jan 8, 2014

    @PVince81
    Contributor

    @schiesbn I heard you there were plans to refactor/rewrite parts of the sharing code, maybe we should start with this one as it directly involves fixing a bug.

  8. Bugsbane commented on Jan 17, 2014

    @Bugsbane

    @PVince81 @schiesbn Worth noting, as there also seem to be similar issues with sharing in other areas, too, such as shared music (in subfolders?) also not showing up in the music app, similarly to this issue. Should this be put in a new issue, or should the title of this one be edited to something like "Shared files do not appear if shared from subfolder"?

  9. Bugsbane commented on Jan 17, 2014

    @Bugsbane

    For the record I'm on 6.0a on lighttp with sqllite db and either php 5.3 or 5.4 (from memory). Last logs look like this:
    Debug core OC_Image->fixOrientation() Orientation: -1 2014-01-17T22:39:36+00:00
    Debug core OC_Image->fixOrientation() No readable file path set. 2014-01-17T22:39:36+00:00
    Debug core OC_Image->loadFromBase64, couldn't load 2014-01-17T22:39:36+00:00
    Error files_sharing File source not found for: /Jeremiah_David-Outro.mp3 2014-01-17T22:41:06+00:00
    Error files_sharing File source not found for: /Jeremiah_David-Outro.mp3 2014-01-17T22:41:05+00:00
    Error PHP Directive 'magic_quotes_gpc' is deprecated in PHP 5.3 and greater at Unknown#0 2014-01-17T22:40:52+00:00
    Error PHP Directive 'magic_quotes_gpc' is deprecated in PHP 5.3 and greater at Unknown#0 2014-01-17T22:40:40+00:00
    Error PHP Directive 'magic_quotes_gpc' is deprecated in PHP 5.3 and greater at Unknown#0 2014-01-17T22:40:22+00:00
    Error PHP Directive 'magic_quotes_gpc' is deprecated in PHP 5.3 and greater at Unknown#0

  10. PVince81 commented on Jan 19, 2014

    @PVince81
    Contributor

    @Bugsbane this is probably the same issue. The sharing code has a method searchByMime that searches through all shared files for given mime types (for images or music) but from what I saw that code isn't able to find into shared subfolders.

    @schiesbn what was the possible solution we discussed for that ?

  11. PVince81 commented on Jan 24, 2014

    @PVince81
    Contributor

    I think the discussed solution was to, for searchByMime call getDirectoryContents() recursively on all the shared folders and gather the files.

    Another point was that for the gallery app we'd only need the first and maybe second level of subfolders to be able to display albums, not all the possible pics.

  12. PVince81 commented on Feb 5, 2014

    @PVince81
    Contributor

    @Bugsbane @githubrsys @caco3 if you like you can help testing the above PR which should fix this issue.

  13. motey commented on Feb 6, 2014

    @motey

    Does not fix the Issue for me. Same behavior as described above. Also did a "TRUNCATE oc_filecache;" with no effects. Any suggestions?

    PHP 5.4.9-4ubuntu2.4
    mysql Ver 14.14 Distrib 5.5.34, for debian-linux-gnu (x86_64)
    ownCloud 6.0.1 (stable)

  14. PVince81 commented on Feb 6, 2014

    @PVince81
    Contributor

    @motey you did apply the PR's patch, right ? (just to double check in case you thought that it was fixed in 6.0.1 already)

  15. motey commented on Feb 6, 2014

    @motey

    my
    apps/files_sharing/lib/cache.php
    is equal to file:
    https://github.com/owncloud/core/blob/fa5ddc3e18a7bddc5510318b34062b31831403a5/apps/files_sharing/lib/cache.php
    from the commit:
    fa5ddc3
    which is from Issue:
    #7089

    thats how it should be, isnt it?

  16. PVince81 commented on Feb 6, 2014

    @PVince81
    Contributor

    @motey yes, thanks for confirming.

    Can you open your browser's network console then open the pictures app and see whether the calls with thumbnail.php failed (404). If yes, please paste one of the URLs here.

    Thanks.

    The original issue was that the path used for thumbnails was wrong, so I wonder what else can go wrong after the fix.

  17. motey commented on Feb 6, 2014

    @motey

    Ok, here is a problem:

    This is a working Thumbnail-URL from the "wrong" shares album listed in the UserDirs:
    https://mydomain.com/index.php/apps/gallery/ajax/thumbnail.php?file=user2%2FShared%2Fhalloween%2Fghostbusernames.jpg&square=1
    In the "Shared" section where it sould be appear it casts a 404 with this URL:
    https://mydomain.com/index.php/apps/gallery/ajax/thumbnail.php?file=user1%2F31%2Fhalloween%2Fghostbusernames.jpg&square=1

    User1 shared his Album with user2 and this is from User2s view.

    thumbnails2

    I doubled checked if the server really calls the cache.php i replaced with the new one, cleared the apc-cache and checked the owncloud log(last log entry 2 days ago, so nothing to do with this issue). Any Ideas?

  18. PVince81 commented on Feb 6, 2014

    @PVince81
    Contributor

    I've merged the PR but let's keep this issue open until your case has been sorted out.
    I'm not sure whether it's directly related, maybe there is some additional fixing needed.

    Actually the pictures currently appears on the top section and at the bottom. At the top it's because of the 'Shared' folder (we might want to exclude that in the future) + the user's own images.
    At the bottom it's one section for each user show shared pics with the current user.

    Before the fix, no pics were shown for me in the top section, but bottom section was ok.
    In your case it's the reverse.
    I'll double check whether it's the same code path, might be another issue to be looked into.

  19. PVince81 commented on Feb 6, 2014

    @PVince81
    Contributor

    @motey are you using encryption ?

  20. PVince81 commented on Feb 6, 2014

    @PVince81
    Contributor

    If yes, then goto #7116 😄

  21. motey commented on Feb 6, 2014

    @motey

    @PVince81 Sry for the late reply. No I dont use encryption. These are the plugins im using:
    plugins

    Maybe i have time this weekend. Then i try to reproduce this issue on a fresh installation

  22. leimia commented on Feb 9, 2014

    @leimia

    Maybe this is helpful to reproduce and fix this issue.

    User1 shares images. User2 is able to see image thumbnails at the top section of the galery, but not at the bottom section of the galery.

    Requested URL for thumbnail:

    http:/mydomain.org/index.php/apps/gallery/ajax/thumbnail.php?file=user1%2Ffolder1%2Ffolder2%2Ffolder3%2Fimage.JPG
    

    PHP Warning in log file:

    Warning  PHP     filemtime(): stat failed for /path/to/owncloud/data/user1/gallery/user1///image.square.JPG at /path/to/owncloud/apps/gallery/lib/thumbnail.php#97
    
  23. joshruggiero commented on Feb 10, 2014

    @joshruggiero

    For me, I did not have thumbnails of shared pictures in either section (neither top nor bottom). After applying the PR7089, I now have the shared pictures in the top section, as a subdirectory of a users own files but still see nothing in the bottom. When mousing over, I get the spinning wheel, as if it is trying to load something. I've used both IE9 and Chrome.

    Connecting via http or https still gives me the same results.

  24. mehturt commented on Feb 10, 2014

    @mehturt
  25. PVince81 commented on Feb 10, 2014

    @PVince81
    Contributor

    I just tried applying the patch to v6.0.1 and I can reproduce the issue.

    However the issue doesn't appear on stable6 and master, which means that there was probably another fix (not sure which one) that made it work there, which means it will also work correctly once 6.0.2 is released.

  26. PVince81 commented on Feb 27, 2014

    @PVince81
    Contributor

    Verified on OC 6.0.2 RC1 using #6496 (comment) and delicious pics:
    gallery_burgers1

  27. locked as resolved and limited conversation to collaborators on Aug 19, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions