Queries 7.7.4: Cannot click records when "Distinct"

We just upgraded to 7.7.4 from 7.6.1 which is great and we really like the new responsive interface.

However, a strange change seems to have taken place with queries…

Whenever we check “Distinct” the record rows are no longer clickable. Maybe this is a feature and not a bug, but I wanted to check to make sure what this is about exactly.

Hi.

This “feature” is a known side-effect how distinct queries. Distinct query results should be navigable · Issue #1464 · specify/specify7 · GitHub

TLDR: If there were two duplicate records they would be merged row into one as part of a “distinct” query, which of the two records should be displayed when you click on the merged row?

Long explanation:

The reason this worked in Specify 7.6.1 is that distinct queries were not doing anything (they were returning same results as non-distinct queries).

This was fixed in 7.7.4. Here is how:

Let’s imagine a query returns the following results:

ID,Prep Type
1,EtOH
2,EtOH

where ID refers to the database record id and is necessary to make the record clickable.

But, since ID is always unique, all rows would be considered unique, and thus “distinct” query would return the same results as a regular query (the 7.6.1 behavior)

In 7.7 this was fixed by making query builder not include the database record id column.

Thus, the same query now looks like this when in distinct mode:

Prep Type
EtOH

Unfortunately, we no longer have a record ID and thus the row is no longer clickable.

3 Likes