HackerOne users: Testing against this community violates our program's Terms of Service and will result in your bounty being denied.
Search
-
Re: Is it possible to know if a Gdn_Model::Save() was successful, without using an autoincrement key?
Technically, it's not a bug, but a design choice. As long as you use a primary key, the insert returns the new key value upon INSERT, and zero upon error. Interestingly, the logic breaks also if you have a composite primary key. The code, which I don't have handy, first fetches the primary key fields (e.g. Field1, Field2,… -
Re: Is it possible to know if a Gdn_Model::Save() was successful, without using an autoincrement key?
That could be an idea. Time for an experiment! It's set in Gdn_SqlDriver::Query(): public function Query($Sql, $Type = 'select') { switch ($Type) { case 'insert': $ReturnType = 'ID'; break; case 'update': $ReturnType = NULL; break; default: $ReturnType = 'DataSet'; break; } [...] Anyway, I decided to override base model,… -
Is it possible to know if a Gdn_Model::Save() was successful, without using an autoincrement key?
I've struggling with an apparently failing Save() statement for a couple of hours, only to find out that it actually saves data correctly, but it doesn't return what one would expect. Environment is Vanilla 2.0.8.18. The table against which the data is saved does not have an autoincrement primary key, but a UUID field,…
3 results