Closed (fixed)
Project:
FileField
Version:
6.x-3.10
Component:
Code
Priority:
Normal
Category:
Support request
Assigned:
Unassigned
Reporter:
Created:
13 Jun 2011 at 00:22 UTC
Updated:
28 Jun 2011 at 03:02 UTC
I using a module that puts node forms in modal dialog pop-ups. I'm using a hook_form_alter function to change some node forms by unsetting some form items. This seems to work well with most field types, with the desired outcome of no actual changes to the database for the unset fields when the node is saved. However with filefield if I unset the form item, when I save the node it deletes all of the data in the filefields for that node. It would be great if there was a work around for something like this for filefield, so I don't have to just css hide it.
Thanks!
Comments
Comment #1
obrienmd commentedsubscribe
Comment #2
quicksketchWell the problem here is that you're doing something unexpected in your code, not that there is an issue with FileField. If you want to remove a field, set #access = FALSE. Don't unset() the field otherwise you'll get all kinds of unexpected issues.
Comment #3
kevinob11 commentedOh awesome, I will do that instead. Thanks!
Comment #4
kevinob11 commentedJust tested, this was exactly what I needed. Thanks again!