I am having trouble getting a "file field" to show as option in the "flash field":
1) I created a New field : File (Type of data), File Upload (Form element to edit the data).
1.1) Permitted upload file extensions: swf
2) Created a New field: Flash (Type of data), Flash Content (Form element to edit the data).
2.1) Name of upload field: (I don't see any options in the drop down!?).

I assume I am doing something wrong, any pointers?

CommentFileSizeAuthor
#3 flashfield.338639.patch811 bytesbaldwinlouie

Comments

andybrace’s picture

I also came across this problem on a site currently in production, we followed the steps:

1. created a file upload field
2. created a flash upload field

However there were no options available in the upload field.

I checked the code and saw that the line causing the problem was found in flashfield.widget.inc (line 34):

        // Retrieve the argument that identifies the content type
        $type = arg(3);

This code uses the name of the content type from the URL to fetch the related file field using an sql call. However for content types that contain underscores the URL would use a hyphen in place of the underscore, so for a content type called "content_type" the url would contain "content-type" so the file field wouldnt be found in the db.

The solution simply involved replacing any occurrence of a hyphen with an underscore, eg:

        // Retrieve the argument that identifies the content type
        $type = arg(3);
        
        //  replace hyphens from URL with underscores
        $type = str_replace("-","_",$type);

Going off the help text for content type name when creating new content types:

The machine-readable name of this content type. This text will be used for constructing the URL of the create content page for this content type. This name must contain only lowercase letters, numbers, and underscores. Underscores will be converted into hyphens when constructing the URL of the create content page. This name must be unique.

this solution should solve the issue.

math_1048’s picture

Hello - I do the same replace above "thank you very much dear openbook " but ............. .
Now solved thank you and
best regards

baldwinlouie’s picture

Status: Active » Needs review
StatusFileSize
new811 bytes

I ran into this same problem. I generated a patch from the suggestion in #1

mark_anthony’s picture

Thanks a lot for the response, sorry I have not been back.

I am not that experienced as a code jockey: where do I put the "// Retrieve the argument that identifies the content type..."
that you supplied?

Thanks,
M

baldwinlouie’s picture

@mark_anthony, take the patch file I created, and apply it to your flashfield.widget.inc.

http://drupal.org/patch/apply that help you get started on applying patches

redpuma’s picture

I too had this problem. My content type had an underscore in the name. Applied the patch above (#3) and everything works fine.

Should I give anymore info or does this suffice?

Barry Madore’s picture

I've applied this patch and it works as advertised: my filefields are now appearing in the dropdown. And, once set, the field accepts and displays uploaded flash files.

jmlavarenne’s picture

Status: Needs review » Reviewed & tested by the community

Same here, suggesting patch be ported, although I suppose the way the widget hooks are implemented is going to need to change to avoid this process.

mobcdi’s picture

Just to clarify is the patch for a component on my server or a patch to the flashfile code in drupal?

If its for the flashfile code would it be wise to use the very latest code available instead of applying the patch

jmlavarenne’s picture

It's for flashfield module. Not sure the very latest code fixes this issue.

Barry Madore’s picture

We've had success using the flashfield module after applying the patch in comment #3. It even turned out to be a crucial component in a recipe using Media Mover, SWF Tools and Flashfield to create a media storage/display solution. We'd like to document the process for install, config and the aforementioned recipe but are reticent to do so until the patch is applied so that the module will work as advertised.

My questions: I know the maintainer is super-busy doing great work on SWFTools, but I'm wondering if there's something else hampering the commitment of the patch. I note that this issue is set as "Component: Documentation. That's not technically accurate. Would changing this to Code make this change priority at all?

Or, is there another way to get the patch committed?

Lastly, if there's a technical reason for the patch to remain uncommitted, I'm eager to know this as well so that we could help move this issue forward by creating and testing new code to have a functional module.

Thanks for the handy module...

Barry Madore

Stuart Greenfield’s picture

@bmadore

Nope - nothing holding back the commit other than time on my part!

Flashfield started as a little bit of an experiment, but if you've used it in a live site that's great, and I'd be really interested to know what you did, and it would be fantastic if you could document what you did.

I will try to roll the patch in this weekend (although I can't promise!). It's not a huge change, and it would get things moving on flashfield if there is active interest in seeing the module develop!

Barry Madore’s picture

Thanks, Stuart. That's what I suspected. We have not moved our implementation which included flashfield to a live site as of yet. We did a proof of concept using the module on its own and then as part of a recipe with the Media Mover module (and related modules). The description of what we accomplished during our users group meeting (to be augmented with detailed documentation soon) is currently here: http://groups.drupal.org/node/19503