FLUID-2938: swfUploadSetupDecorator options not being passed on

Metadata

Source
FLUID-2938
Type
Bug
Priority
Major
Status
Closed
Resolution
Won't Fix
Assignee
Colin Clark
Reporter
Anastasia Cheetham
Created
2009-06-10T12:34:48.000-0400
Updated
2011-01-20T15:09:45.269-0500
Versions
  1. 1.1
Fixed Versions
N/A
Component
  1. Uploader

Description

When the Uploader options are used to specify a non-custom browse button url for the swfUploadSetupDecorator, the options are not reaching the swfUploadSetupDecorator subcomponent, and the default button url is still being used.

To reproduce:

Assuming you're working on a locally checked out copy of the code:
1) Edit the Uploader template file at components/uploader/html/Uploader.html
2) Add a decorators option to the script block, as follows:
var myUploader = fluid.progressiveEnhanceableUploader(".flc-uploader", ".fl-progEnhance-basic", {
demo: true,
uploadManager: "fluid.swfUploadManager",
decorators: {
type: "fluid.swfUploadSetupDecorator",
options: {
flashButtonImageURL: "../images/error.png"
}
}
(note that the flashButtonImageURL can be anything other than the default string, which is "../images.browse.png")
3) Reload the template file in the browser.

Note that the default browse button image is still being used.

Comments

  • Colin Clark commented 2009-06-29T17:36:17.000-0400

    This isn't actually a bug, though it is remarkably confusing. Since there may be several decorators attached to a component, the decorator options need to be wrapped in an array, even if there is only one decorator being specified. This code should work:

    var myUploader = fluid.progressiveEnhanceableUploader(".flc-uploader", ".fl-progEnhance-basic", {
    demo: true,
    uploadManager: "fluid.swfUploadManager",
    decorators: [{
    type: "fluid.swfUploadSetupDecorator",
    options: {
    flashButtonImageURL: "../images/error.png"
    }
    }]
    };

    Note the square brackets around the value of decorators:

    The larger issue of how decorators are configured will be fixed with the introduction of our new IoC container in Infusion 1.2. Keep an eye out for it soon.