You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Shared pics folder do not appear if shared from subfolder #6496
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.
Share "pics" with "user2" and leave the permissions as is
Login as "user2"
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"}
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 ?
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...
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. 😦
@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.
@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"?
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
@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 ?
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.
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.
User1 shared his Album with user2 and this is from User2s view.
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?
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.
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
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.
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.
Activity
PVince81 commentedon Dec 19, 2013
Steps to reproduce:
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 ?
PVince81 commentedon Dec 19, 2013
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 ?
caco3 commentedon Dec 23, 2013
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 !!!
[...]
PVince81 commentedon Jan 8, 2014
Looks like the method
searchWithWhere()inapps/files_sharing/lib/cache.phpis returning the wrong path for files found in subdirs of shared paths.In the case mentionned above, instead of returning
/picsit returns the path with the base dir as/basedir/picswhich breaks the preview generation / image display later. This might potentially break other apps as well...PVince81 commentedon Jan 8, 2014
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. 😦
PVince81 commentedon Jan 8, 2014
@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.
Bugsbane commentedon Jan 17, 2014
@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"?
Bugsbane commentedon Jan 17, 2014
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
PVince81 commentedon Jan 19, 2014
@Bugsbane this is probably the same issue. The sharing code has a method
searchByMimethat 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 ?
PVince81 commentedon Jan 24, 2014
I think the discussed solution was to, for
searchByMimecallgetDirectoryContents()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.
PVince81 commentedon Feb 5, 2014
@Bugsbane @githubrsys @caco3 if you like you can help testing the above PR which should fix this issue.
motey commentedon Feb 6, 2014
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)
PVince81 commentedon Feb 6, 2014
@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)
motey commentedon Feb 6, 2014
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?
PVince81 commentedon Feb 6, 2014
@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.phpfailed (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.
motey commentedon Feb 6, 2014
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.
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?
PVince81 commentedon Feb 6, 2014
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.
PVince81 commentedon Feb 6, 2014
@motey are you using encryption ?
PVince81 commentedon Feb 6, 2014
If yes, then goto #7116 😄
motey commentedon Feb 6, 2014
@PVince81 Sry for the late reply. No I dont use encryption. These are the plugins im using:

Maybe i have time this weekend. Then i try to reproduce this issue on a fresh installation
leimia commentedon Feb 9, 2014
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:
PHP Warning in log file:
joshruggiero commentedon Feb 10, 2014
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.
mehturt commentedon Feb 10, 2014
I see a similar (maybe the same) issue, I described it here http://forum.owncloud.org/viewtopic.php?f=26&t=19606&p=53023
Basically the path to the thumbnail is wrong.
PVince81 commentedon Feb 10, 2014
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.
PVince81 commentedon Feb 27, 2014
Verified on OC 6.0.2 RC1 using #6496 (comment) and delicious pics:
