Quick 2.5.4, qb 7:
If you have a scope or some query logic that returns an empty recordset, but attach a with() call, e.g.
QB will throw an error because it is trying to run a query like:
I’m going to need more than this. I tried to add a test to show this failing and I couldn’t get the test to fail for both a belongsTo and a hasMany relationship.
I’m not able to reproduce this manually either. The bug report we have uses a scope, a .select(), and .with(). Here’s the Stack trace just in case this pops up again:
Figured this out:
If you specify a .select() when instantiating a Quick entity, it looks like it has to be an array of field names. We had some code that was supplying a comma-delimited list, e.g.
.select( “firstname”, “ID”)
This will not throw an exception but it will only select firstname. When it goes to eager load the attached records, it sees a null ID and that’s why it threw this exception.
Presumably a comma-delimited string for .select() used to work but does not any longer.
Did you install qb 7 manually? That was a breaking change in qb 7, but it shouldn’t install automatically for Quick 2.*. Also, a comma-delimited string still works (select( "one,two")), but variadic parameters do not (select( “one”, “two” )).
Yes, we did. I even saw that note but didn’t realize we were using variadic parameters until I went back and looked at it.