You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi all!
I've detected what could be a bug.
When you use the fields() function, it sets the _select property of the MY_Model class (declared in line 182). Then, when it fetches data and goes to _prep_after_read, in line 391 it sets _select back to the default "*".
Problem is that _prep_after_read is only called when the query brings back 1 or more rows. Not otherwise. Meaning that _select remains with the previous value. So if you do two querys, one after the other, and the first one doesn't return any row, the next one will try to fetch the same fields as the first, potentially causing errors (if query one and query two, for instance, use different tables).
Here's how lines from 983, on function get(), reads.
Hi all!
I've detected what could be a bug.
When you use the fields() function, it sets the _select property of the MY_Model class (declared in line 182). Then, when it fetches data and goes to _prep_after_read, in line 391 it sets _select back to the default "*".
Problem is that _prep_after_read is only called when the query brings back 1 or more rows. Not otherwise. Meaning that _select remains with the previous value. So if you do two querys, one after the other, and the first one doesn't return any row, the next one will try to fetch the same fields as the first, potentially causing errors (if query one and query two, for instance, use different tables).
Here's how lines from 983, on function get(), reads.
And this is the patch I've made to solve this issue.
And the same goes for function get()
The text was updated successfully, but these errors were encountered: