Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Only use values from form_columns on item updates #63

Open
racke opened this issue Feb 27, 2015 · 5 comments
Open

Only use values from form_columns on item updates #63

racke opened this issue Feb 27, 2015 · 5 comments
Assignees

Comments

@racke
Copy link
Member

racke commented Feb 27, 2015

  • Less data to transfer => quicker
  • Prevents tampering of data
  • Doesn't interfere with preseed methods in the database schema
@racke
Copy link
Member Author

racke commented Apr 24, 2015

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
Copy link
Member Author

racke commented Apr 24, 2015

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

@gregapompe
Copy link
Contributor

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
Copy link
Member Author

racke commented Apr 24, 2015

I'm working on a patch.

@racke
Copy link
Member Author

racke commented Apr 24, 2015

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants