bmidget/kohana-formo — Issue #156: File driver + ORM can't create field with optional file
Author: d4rky-pl
Created: 2011-12-06 13:18:27+00:00
State: open

When pulling stuff from ORM, if you set up a field to use file driver, there's no way to make it optional field. This happens because you made file operations callback-specific and the data from $_FILES is being put directly into ORM model to be poked with later.

This way it's impossible to simply not change a database field value - setting field to NULL in callback will try to set field to null and simply leaving it will cause an error like this:

Database_Exception [ 1241 ]: Operand should contain 1 column(s) [ UPDATE `categories` SET `filename` = ('', '', '', 4, 0), `description` = 'Lorem ipsum ' WHERE `id` = '1' ]

_sorry in advance if I speak gibberish right now_