interchange / TableEditor

25 stars 4 forks source link

Only use values from form_columns on item updates #63

Open racke opened 9 years ago

racke commented 9 years ago
racke commented 9 years ago

Also it is a bug - if you have a foreign key in the table which can be NULL but the column isn't included in form columns, you get sth like that:

request to POST /api/Category crashed: DBIx::Class::Storage::DBI::_dbh_execute(): DBI Exception: DBD::Pg::st execute failed: ERROR: insert or update on table "categories" violates foreign key constraint "categories_supplier_fkey"
DETAIL: Key (supplier)=() is not present in table "vendors"
racke commented 9 years ago

Grega, how can we limit the item update to form columns only?

gregapompe commented 9 years ago

Dropdown is safest but not always ok. Autocomplete doesn't restrict it, but there may be a way to ensure only suggested items have been selected. I don't have time right now to look into details.

racke commented 9 years ago

I'm working on a patch.

racke commented 9 years ago

This patch should be good, though it is possible we get regressions. It is definitely the right way to do.