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

Error loading slideshow template #121

Closed
TimJay opened this issue Apr 12, 2015 · 27 comments
Closed

Error loading slideshow template #121

TimJay opened this issue Apr 12, 2015 · 27 comments
Assignees
Labels
Milestone

Comments

@TimJay
Copy link

TimJay commented Apr 12, 2015

When I view a folder in galleryplus, the previews are shown but I am not able to view an individual image. On top of the view, an orange info-box appears 'Error loading slideshow template'. When I click one of the previews, nothing happens.
owncloud-galleryplus-error

OwnCloud version: 8.0.2
App version: 2.0.8
Browser version: Chrome 41.0.2272.76 (64-bit) / KUbuntu 14.04
PHP version: 5.5.9+dfsg-1ubuntu4.7

owncloud.log:

{"reqId":"c2368bc2c7c2fb838125c3e81e921905","remoteAddr":"x.x.x.x","app":"galleryplus","message":"Supported Mimes: {\"image\/png\":\"\/owncloud\/core\/img\/filetypes\/image.png\",\"image\/jpeg\":\"\/owncloud\/core\/img\/filetypes\/image.png\",\"image\/gif\":\"\/owncloud\/core\/img\/filetypes\/image.png\",\"image\/x-xbitmap\":\"\/owncloud\/core\/img\/filetypes\/image.png\",\"image\/bmp\":\"\/owncloud\/core\/img\/filetypes\/image.png\",\"image\/tiff\":\"\/owncloud\/core\/img\/filetypes\/image.png\",\"image\/x-dcraw\":\"\/owncloud\/core\/img\/filetypes\/image.png\",\"application\/x-photoshop\":\"\/owncloud\/core\/img\/filetypes\/image.png\",\"application\/illustrator\":\"\/owncloud\/core\/img\/filetypes\/image-vector.png\",\"application\/postscript\":\"\/owncloud\/core\/img\/filetypes\/image-vector.png\",\"image\/svg+xml\":\"\/owncloud\/core\/img\/filetypes\/image-vector.png\"}","level":0,"time":"2015-04-12T14:35:19+00:00","method":"GET","url":"\/owncloud\/index.php\/apps\/galleryplus\/mediatypes?"}
{"reqId":"d9308863532c2c66e7d08381f2ed2a5e","remoteAddr":"x.x.x.x","app":"galleryplus","message":"[PreviewService] Fetching the preview","level":0,"time":"2015-04-12T14:35:19+00:00","method":"GET","url":"\/owncloud\/index.php\/apps\/galleryplus\/thumbnails?images=Pictures%2FDebug%2FIMAG0652.jpg%3BPictures%2FDebug%2FIMAG0662.jpg%3BPictures%2FDebug%2FPTIM9956.jpg&scale=1&square=0&requesttoken=xx.xx"}
{"reqId":"d9308863532c2c66e7d08381f2ed2a5e","remoteAddr":"x.x.x.x","app":"galleryplus","message":"[PreviewService] Fetching the preview","level":0,"time":"2015-04-12T14:35:19+00:00","method":"GET","url":"\/owncloud\/index.php\/apps\/galleryplus\/thumbnails?images=Pictures%2FDebug%2FIMAG0652.jpg%3BPictures%2FDebug%2FIMAG0662.jpg%3BPictures%2FDebug%2FPTIM9956.jpg&scale=1&square=0&requesttoken=xx.xx"}
{"reqId":"d9308863532c2c66e7d08381f2ed2a5e","remoteAddr":"x.x.x.x","app":"galleryplus","message":"[PreviewService] Fetching the preview","level":0,"time":"2015-04-12T14:35:19+00:00","method":"GET","url":"\/owncloud\/index.php\/apps\/galleryplus\/thumbnails?images=Pictures%2FDebug%2FIMAG0652.jpg%3BPictures%2FDebug%2FIMAG0662.jpg%3BPictures%2FDebug%2FPTIM9956.jpg&scale=1&square=0&requesttoken=xx.xx"}
@deMattin
Copy link

Tested with actual Chrome 32bit and 64bit (Canary version) with Windows 7 and can't reproduce the issue.
Did you install the download of gallery+ 2.0.8 on your oC server?
If so, maybe it will be a good idea to install it via git to get all fixes, because gallery+ is under heavy development right now!

@TimJay
Copy link
Author

TimJay commented Apr 12, 2015

I tried the packaged 2.0.8 file from releases, git branch stable8, and git branch master, they all lead to the same behaviour.
I skipped the patches for raw images and performance when installing, maybe that is related? Does galleryplus rely on some additional dependencies to actually show full images?

@deMattin
Copy link

Patches can't be the cause, because I didn't have installed them, too.
Actually I use master branch on git.
I think, we have to wait, if oparoz has an idea on this.

@oparoz oparoz added the bug label Apr 12, 2015
@oparoz
Copy link
Contributor

oparoz commented Apr 12, 2015

Thanks for the report.
I can confirm that patches are not required for things to work properly.

@TimJay

  • Is the folder named 'galleryplus'?
  • Did you restart PHP/Apache?

I find it odd that 3 requests are being made for the same files, but I don't know why this occurs.

@TimJay
Copy link
Author

TimJay commented Apr 12, 2015

  • Yep: /var/www/owncloud/apps-contrib/galleryplus
  • Yep: sudo service apache2 restart

I realized that I get the error notification also in the Files module. Even there I cannot open image files.

Strange with the duplicated request. The folder I used to create this log was named Debug and contained three files IMAG0652.jpg, IMAG0662.jpg, and PTIM9956.jpg. I refreshed the folder and then clicked each image once.

@oparoz
Copy link
Contributor

oparoz commented Apr 12, 2015

Thanks. That comes from something I've been meaning to take a look at for a while.
You're using a secondary apps folder for non-official apps and there are some hard-coded paths in the code.
We can't use the old methods from "Pictures" as it's going to be deleted from core soon, so I need to write something new.

The multiple thumbnail requests might come from redirects.

@TimJay
Copy link
Author

TimJay commented Apr 12, 2015

Nice, that was fast 😄
Please let me know when there's something to test.

@oparoz oparoz closed this as completed in 1af8280 Apr 12, 2015
@oparoz
Copy link
Contributor

oparoz commented Apr 12, 2015

It's fixed in master, but it's just too strange to have to use apps on the files side and the custom folder on the gallery side.

@TimJay
Copy link
Author

TimJay commented Apr 12, 2015

I pulled master and restarted apache, but it still won't work. Also there's another hardcoded apps/galleryplus in line 243. Making that relative did not have any effect either:

return OC.generateUrl(appWebRoot + endPoint + extension + path, null) + '?' + query;

@oparoz
Copy link
Contributor

oparoz commented Apr 12, 2015

Line 243 has to stay as is, for the reason mentioned above.

Try to hit ctrl+f5 a few times to refresh the javascript.

@TimJay
Copy link
Author

TimJay commented Apr 12, 2015

git reset --hard, now on master 1af8280, restarted apache, restarted chrome, ctrl-F5 multiple times, and I'm still getting the 'Error loading slideshow template' warning and cannot open images.

@oparoz
Copy link
Contributor

oparoz commented Apr 12, 2015

OK, so there may be another error.

Please turn on browser debugging via F12 and go to the network tab.
What is the error number and what is the URL it's trying to find the template at?

@TimJay
Copy link
Author

TimJay commented Apr 12, 2015

Request URL:https://xxx.xx/owncloud/owncloud/apps-contrib/galleryplus/templates/slideshow.html
Request Method:GET
Status Code:404 Not Found

The duplicate owncloud/ looks weird.

@oparoz
Copy link
Contributor

oparoz commented Apr 12, 2015

The duplicate owncloud/ looks weird.

Yes it does :)

What do you get when you type this in the javascript console?
OC.appswebroots.galleryplus

@TimJay
Copy link
Author

TimJay commented Apr 12, 2015

"/owncloud/apps-contrib/galleryplus"

@oparoz
Copy link
Contributor

oparoz commented Apr 12, 2015

OK, so you've probably mis-configured your custom apps folder.

It should look like this:

'apps_paths' => array(
    array(
...
        'url' => '/apps-contrib',
...
    ),
),

"The key url defines the HTTP web path to that folder, starting from the ownCloud web root"

@TimJay
Copy link
Author

TimJay commented Apr 12, 2015

  'apps_paths' => 
  array (
    0 => 
    array (
      'path' => '/var/www/owncloud/apps',
      'url' => '/apps',
      'writable' => false,
    ),
    1 => 
    array (
      'path' => '/var/www/owncloud/apps-contrib',
      'url' => '/apps-contrib',
      'writable' => true,
    ),
  ),

@oparoz
Copy link
Contributor

oparoz commented Apr 12, 2015

Thanks.
So it seems, that the appswebroots variable is already aggregating everything.
I don't have a setup like this, so you'll have to test a few things manually if you can.

@oparoz oparoz reopened this Apr 12, 2015
@oparoz
Copy link
Contributor

oparoz commented Apr 12, 2015

Please try to replace

var appWebRoot = OC.appswebroots.galleryplus;

with

var appWebRoot = OC.appswebroots.galleryplus;
appWebRoot = appWebRoot.replace(OC.webroot, '');

It's all a bit hackish, but they're removing the one method which does all the magic path building...

@TimJay
Copy link
Author

TimJay commented Apr 12, 2015

That works 👍
The path comes from core/js/config.php line 48...

$apps_paths = array();
foreach(OC_App::getEnabledApps() as $app) {
    $apps_paths[$app] = OC_App::getAppWebPath($app);
}

Where is the value defined which getAppWebPath($app) returns?

@TimJay
Copy link
Author

TimJay commented Apr 12, 2015

Anyhow, thanks a lot for this quick support. I'll hit the hay, tty tomorrow. 😄

@oparoz
Copy link
Contributor

oparoz commented Apr 12, 2015

I'm glad that works.
I'll take a look at what the core apps are using tomorrow, to see if there is a smarter way to do this and will update this ticket once the fix is in.
Thanks for testing :)

@oparoz oparoz closed this as completed in db936a0 Apr 13, 2015
@oparoz
Copy link
Contributor

oparoz commented Apr 15, 2015

@TimJay I've pushed a different way of doing things. Could you check that master still works for you?

@deMattin
Copy link

I get some of the following errors in log:
Error PHP Undefined index: features at /var/www/owncloud/apps/galleryplus/controller/filescontroller.php#105
And if I click fast through gallery (not all previews shown) and change path via broadcrump, I sometimes have got the "no pictures found" message.
It's hard to force or reproduce because browser caching seems to "fix" this mostly.

Don't know, if this has to do with this actual changes ...

@oparoz
Copy link
Contributor

oparoz commented Apr 15, 2015

The index error is not important, but I'll fix it at some point.

Regarding the rapid change of album, it would be good if you could give me a browser error.
Could be too much recursion or missing object.
The main problem is that basically you're still getting thumbnails for the old album and it can happen that they're not discarded properly.

And it's got nothing with the recent change :)

@TimJay
Copy link
Author

TimJay commented Apr 18, 2015

@oparoz Everything works all right. I don't get any errors when 'fast-browsing' ...

@oparoz
Copy link
Contributor

oparoz commented Apr 19, 2015

Thanks.

@oparoz oparoz added this to the 2.0.10 milestone Apr 19, 2015
@oparoz oparoz self-assigned this Jun 25, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants