Just updated filefield upon security warning. After update I am unable to upload pdf files to scribdfield. I made an issue with filefield, but as a feature request, perhaps a field that allows the admin to filter different file extensions? I checked the cck field and I dont see any options, I also checked the scribdfield admin page... any help is appreciated, LOVE the module. :)

CommentFileSizeAuthor
#9 scribdfield.patch781 bytesnoomz

Comments

quicksketch’s picture

The issue over in FileField is #791208: scribdfield only accepts .txt files upon recent filefield security update. Here's re-statement of what I said over there.

This negative effect on scribdfield is actually the direct problem that FileField 3.3 addressed as part of the security update. FileField previously would sometimes allow *all* file extensions inadvertently. If no extensions are specified at all (as in the value of the extension list is NULL), then FileField restricts to "txt" as a precaution (since that's what's intended to be the default).

I think this will need to be fixed in scribdfield and have it show the supported extensions field so the administrator can specify the list.

radune’s picture

Any ideas on how to use this module with the current FileField update?

Thanks!

POVYLAZZZ’s picture

Hi,
I gave found a little temporary fix for this... I opened filefield.module file found line $field['widget']['file_extensions'] = 'txt'; and added $field['widget']['file_extensions'] = 'pdf'; It should fix the problem I was also playing around with other files so it may be not the only line which need fixing if that would be the case pleas write I will try to help.
There is also a similar module just not based on scribd but on Issuu. Issuu is like a sexy cousin of scribd ;) And that module was actually inspired by this one, so I think that this modules developer does not even have to write the fix from scratch....

ajinkya.kulkarni’s picture

Component: Miscellaneous » Code
Category: support » bug

Thanks POVYLAZZZ

I have added needed extensions manually to filefield module.

// Match the default value if no file extensions have been saved at all.
if (!isset($field['widget']['file_extensions'])) {
$field['widget']['file_extensions'] = 'pdf ps doc docx ppt pps pptx xls xlsx odt sxw odp sxi ods sxc txt rtf';
}

Does filefield support configuration page for customizing these extensions? I did not find it.

quicksketch’s picture

FileField (and ImageField) both provide fields for customizing the extension list. The problem is that Scribd field actually disables the configuration option so that you can't enter your own extension list.

POVYLAZZZ’s picture

So... the only solution is to hack FF module?
I have just updated the FF module and hoped that things may be slowed by new version it seams I was wrong. And in this modules side is there any improvement of fixing this?

quicksketch’s picture

The solution is to fix Scribd, not to hack FileField. This is not a bug in FileField, it's a security fix on its side. Scribd should simply not hide the extension field when configuring a file field so that you can enter other extensions. Right now it's hiding the extension field (supposedly to allow all extensions), but it needs to keep that field visible. I don't use Scribd personally so I won't be spending any time working on correcting this behavior.

casv’s picture

I fixed it with this:

in scribfield.module

/**
* Implementation of CCK's hook_widget().
*/
function scribdfield_widget(&$form, &$form_state, $field, $items, $delta = 0) {
$field['widget']['file_extensions'] = 'pdf ps doc docx ppt pps ppsx pptx xls xlsx odt sxw odp sxi ods sxc txt rtf'; //added this line
return filefield_widget($form, $form_state, $field, $items, $delta);
}

noomz’s picture

StatusFileSize
new781 bytes

Hi,

For me, I want to have its own settings on cck field settings page (like admin/content/node-type/xxx/fields/field_scribd), so you can filled in any document type you want. I've attached the patch below.

Glad if this patch is useful :),
Noomz

BrockBoland’s picture

Status: Active » Reviewed & tested by the community

The patch in comment #9 did it for me. Thanks noomz!

Perhaps the field should also default to 'pdf' instead of 'txt', but at least it works.

mikl’s picture

Version: 6.x-1.0 » 6.x-1.x-dev
Assigned: Unassigned » mikl
Status: Reviewed & tested by the community » Fixed

Committed patch from #9 to 6.x-1.x. Thanks :)

lsolesen’s picture

Just tried out the dev version. If people stumble on the problem, make sure that the widget is setup to allow more types as the default is only txt.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.