One file field to rule them all

Update: Most of the stuff below does not apply anymore, as dopry has decided to throw away most of that code because he found it to be too experimental. Whether that is a good thing or not is up to the reader - personally I'm a bit disappointed about that move, but not enough to fork FileField. End of update, original posting follows.

Hi Planet! Without a doubt, you were most probably wondering what I was up to after my Summer of Code student seemingly disappeared without further notice (and is still missing in action). Well, your desire for information shall be appeased. If you inferred something from the title, you were right:

FileField for Drupal 6 is coming!

And coming strong. In fact, I think it's a lot nicer than any FileField version for Drupal 5. That wasn't to be expected a month ago when there was no D6 port at all, but fortunately our lovely Larry Garfield came along and ported the changes from the initial but yet unfinished ImageField 6.x to FileField.

That got me hooked. File uploads were basically working, but everything else was just as badly broken still. It seems to me that FileField was affected by every single large change that Drupal 6 and its companions - CCK 6.x-2.x, Views 2 - brought along. Uploads, AHAH, CCK widget interactions, Views integration, and a lot more, all of those essentially required to be rewritten nearly from scratch. Ok, Views integration was a no-brainer thanks to Views 2, and is infinitely more capable than the previous one.

All in all, little remains from the original FileField code, and in addition to the plain porting effort I also worked on making the widget and formatter more extensible. And of course, there can only be a single consequence:

Image support for FileField is coming too!

In less than 200 lines, that is. The majority of those being registration hooks, theme wrapper functions and comments. But then, two images say more than 351 words:


If the one or the other maintainer of some <whateverfileformat>field module jumps on the bandwagon then we should easily be able to phase out like two or three modules, replaced by significantly smaller (and more maintainable) FileField extension modules. Let's fight code duplication and unify CCK managed files from a unified codebase! Anyone feel like helping out with the one or the other feature or with a new file handler in addition to the generic and the image ones?