Why no hook_field_settings?
bigheadfish - October 27, 2009 - 23:22
| Project: | ImageField |
| Version: | 6.x-3.2 |
| Component: | Code |
| Category: | support request |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | active |
Jump to:
Description
Hi there,
I am learning CCK development. CCK documentation is poor :(
There is no implementation of hook_field_settings in this module. Could you please explain why?
My understanding is that hook_field_settings is not mandatory. We can also use hook_widget_settings to replace it. The only difference is that hook_field_settings gives/saves common information that does not matter which widget (if have many widget) is in use. hook_widget_settings saves widget dependent information (like how many rows a textarea has, the length of a textfield, etc).
Is my understanding right?
Thanks,

#1
Yes that's pretty much correct. There is no hook_field_settings() in this module because ImageField does not actually provide a "field" in the CCK sense. A "field" in CCK means that it provides a way to store data in the database. Since ImageField builds on FileField, it uses FileField's hook_field_settings(). ImageField is just a widget for FileField's field.