plegall / Piwigo-community

11 stars 23 forks source link

Revision 2.9.a-beta (2017-06-26) does not allow upload from non-admin user #31

Closed Cadencia closed 6 years ago

Cadencia commented 6 years ago

Users can no longer upload photos using the community plugin following update of Piwigo and community plugin to latest version (2.9.1).  I have copied all the files from the distribution zip to the server using ftp, and deactivated all other plugins to no avail.  I have cleared the browser caches - tried Chrome, Firefox and Edge from windows 10, and from safari under el capitan on mac and ios10 - all the same result.

The user is left with the "Your browser doesn't have HTML5 support" text from the community javascript.

If I allow a user to be an administrator, the community plugin upload shows the html5 uploader after a short interval, overwriting the "Your browser doesn't have HTML5 support".

Piwigo version: 2.9.1 PHP version: 5.4.16 MySQL version: 5.5.52-MariaDB Centos 7

EddyLB commented 6 years ago

Indeed, non-admin users are left with the "Your browser doesn't have HTML5 support" text.

plegall commented 6 years ago

OK, and another report (with slightly more details) on http://piwigo.org/forum/viewtopic.php?id=28187

plegall commented 6 years ago

I'm working on this issue, but I can't reproduce it :-/ I have installed a fresh Piwigo 2.9.1 + Community 2.9.a-beta but I have no problem to see the upload form and upload some photos with a non admin user.

Can you give me more details? What is the status of the user? Do you see anything in the web browser console (like a javascript error)?

EddyLB commented 6 years ago

When logged as non-admin, an error is indeed raised in the browser. In the index.php file, I get this code in lines 532-534:

var sizeLimit = Math.round(62914560 / 1024); /* in KBytes */
var sumQueueFilesize = 0;
varr limit_storage = 52428800;     <<==== ERROR

When logged as admin, there is no error and the code does not contain the 3rd line :

var sizeLimit = Math.round(62914560 / 1024); /* in KBytes */
var sumQueueFilesize = 0;

Hope this helps.

Cadencia commented 6 years ago

I have the same invalid varr statement. I have done experiments and find it is caused by having a maximum byte limit on the user. Removing the limit removes the problem. I suppose administrators have no limit by definition, sort of.

I look forward to a fix.

Thanks, Phil

celdaran commented 6 years ago

Removing the limit removes the problem

Confirmed. I was getting the same "doesn't have HTML5 support" error for non-Admins and tried removing the limit too, after reading above. Now everyone can upload.

Not the ideal solution, but it's a solution I can at least move forward with for the time being! Thanks @Cadencia

Charlie

Cadencia commented 6 years ago

Is there any fix for this forthcoming? The problem is that line 183 of add_photos.tpl has a typo, what should be "var" is spelled "varr".

I've hacked my copy, but it would be nice to have it official.

Regards Phil

EddyLB commented 6 years ago

Same issue with:

@Cadencia, which version of Piwigo do you use? Where is the add_photos.tpl file?

Cadencia commented 6 years ago

My site details on first item this thread, updated to 2.9.2 just now.

The file in error is .../piwigo/plugins/community/add_photos.tpl

(... is , on my system, /home/mydomainname/public_html)

Cadencia commented 6 years ago

Whoops. Didn't mean to close!

EddyLB commented 6 years ago

Thanks @Cadencia. I've fixed the typo in my Piwigo and that works well 👍 I realise that this issue has already been fixed in the master, see https://github.com/plegall/Piwigo-community/commit/9fb48fa2e4efebc64035dc2402e26edaf701276f.

@plegall , would it be possible to release an update of v2.9.a-beta?

plegall commented 6 years ago

Fixed by 9fb48fa2e4efebc64035dc2402e26edaf701276f