Mlix / nextgen-gallery

Automatically exported from code.google.com/p/nextgen-gallery
0 stars 0 forks source link

Problems with user upload permissions #469

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
I have followed up on this thread 
http://wordpress.org/support/topic/plugin-nextgen-gallery-unable-to-write-to-dir
ectory-is-this-directory-writable-by-the-server?replies=5 stating that they 
have problems uploading images. They seem to get an error about the folder 
being writable, possibly also related to the bug reports on the swf uploader. 
In the thread Skyalex suggested that the $gallery->abspath was sometimes 
missing.

I have started digging into that problem and the status is that the cached 
object that is retrieved in the nggdb::find_gallery() does not always contain 
the abspath variable.

I am uncertain what the best solution is yet. As I see it there are multiple 
options.

1. Get the cached object and continue to do some post processing on it. Then we 
could possibly save it again after that.

2. Avoid caching a partial object. It seems that we cache the object in 
find_all_galleries as well, so we could add the abspath there. This is probably 
the better solution.

I am working on a solution for the problem, I just wanted to capture my first 
findings in case someone else want to come up with a solution.

/Kristian

One more thing I just noted in the code is that in line 164 of nggdb.php we use 
wp_cache_add which wont do anything since the cache id already exist. Since we 
want to  overwrite the existing entry we need to change it to wp_cache_set. 
Patch incoming for that as well.

Original issue reported on code.google.com by kristian...@gmail.com on 7 Feb 2012 at 11:47

GoogleCodeExporter commented 9 years ago
I have made a patch such that the find_all_galleries include the abspath and 
thus we avoid caching partial objects.

I have also changed the caching to overwrite the existing cache in case we need 
to add a counter.

I couldn't recreate the upload problems people are experiencing, but this 
should if nothing else solve the problem of the missing abspath

Original comment by kristian...@gmail.com on 8 Feb 2012 at 6:34

Attachments:

GoogleCodeExporter commented 9 years ago
Let's give it a try . fixed in r1070

Original comment by alex.cologne on 17 Feb 2012 at 4:03