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

obrienmd’s picture

subscribe

quicksketch’s picture

Category: bug » support
Status: Active » Fixed

Well 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.

kevinob11’s picture

Oh awesome, I will do that instead. Thanks!

kevinob11’s picture

Just tested, this was exactly what I needed. Thanks again!

Status: Fixed » Closed (fixed)

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