7913 Posts in 1355 Topics by 930 members
DataObjectManager Module
SilverStripe Forums » DataObjectManager Module » Uploadify: patch which sets folder dropdown to $uploadFolder by default
Discuss the DataObjectManager module, and the related ImageGallery module.
Moderators: martimiz, UncleCheese, Howard, Sean, Ryan M., biapar, Willr, Ingo, swaiba, simon_w
| Go to End | Next > | |
| Author | Topic: | 1776 Views |
-
Uploadify: patch which sets folder dropdown to $uploadFolder by default

3 September 2010 at 5:17am
Using uploadify, I noticed that if I set uploadFolder (e.g. to "Videos") & then allow folder selection during uploads, the dropdown for folder selection ALWAYS resulted in "assets/Uploads" being highlighted by default -- instead of "assets/Videos".
Below is a patch to correct. From what I gather, this was the intended behavior, as the $folder variable was never accessed after checking if $uploadFolder exists.
Index: www/uploadify/code/UploadifyField.php
===================================================================
--- www/uploadify/code/UploadifyField.php (revision 13)
+++ www/uploadify/code/UploadifyField.php (working copy)
@@ -485,7 +485,7 @@
*/
public function CurrentUploadFolder() {
if($this->uploadFolder) {
- $folder = Folder::findOrMake($this->uploadFolder);
+ return Folder::findOrMake($this->uploadFolder);
}
if($result = $this->Files()) {
if($result instanceof File) { -
Re: Uploadify: patch which sets folder dropdown to $uploadFolder by default

3 September 2010 at 7:15am
Thanks, Brice. Yeah, this function changed a number of times before I figured out exactly how I wanted it to work, so I'm not surprised. I originally had that second if block as an elseif, but either way the result is the same. Thanks for the patch.
----------------
Silverstripe tips, tutorials, screencasts, and more.. http://www.leftandmain.com -
Re: Uploadify: patch which sets folder dropdown to $uploadFolder by default

28 August 2011 at 1:45pm
I downloaded the latest version of unlcecheese's uploadify for ss. where should i put your code in brice? i can't find this code segment in the uploadifyfield.php :/
thanks benni
-
Re: Uploadify: patch which sets folder dropdown to $uploadFolder by default

31 August 2011 at 1:43am
That patch isn't valid anymore because that function has changed. What is the issue you're having?
--------------------
SilverStripe tips, tutorials, screencasts and more: http://www.leftandmain.com -
Re: Uploadify: patch which sets folder dropdown to $uploadFolder by default

31 August 2011 at 2:24am Last edited: 31 August 2011 2:25am
Doesn't matter which folder i choose. the upload is always into the folder "Uploads" and NOT into the selected one.
// i'm using the latest version of your uploadify
-
Re: Uploadify: patch which sets folder dropdown to $uploadFolder by default

1 September 2011 at 1:15am
You're remembering to click "change?"
--------------------
SilverStripe tips, tutorials, screencasts and more: http://www.leftandmain.com -
Re: Uploadify: patch which sets folder dropdown to $uploadFolder by default

1 September 2011 at 5:12am
Yep ;)
-
Re: Uploadify: patch which sets folder dropdown to $uploadFolder by default

2 September 2011 at 2:41am
Can you help?
| 1776 Views | ||
| Go to Top | Next > |


