Skip to content

Inclusion of null taxontreedef in query results - #6380

Merged
acwhite211 merged 1 commit into
productionfrom
issue-5479
Apr 10, 2025
Merged

Inclusion of null taxontreedef in query results#6380
acwhite211 merged 1 commit into
productionfrom
issue-5479

Conversation

@acwhite211

@acwhite211 acwhite211 commented Apr 1, 2025

Copy link
Copy Markdown
Collaborator

Fixes #5479

Include Collection Objects with null taxon determinations to be returned when searching for Any taxon.

Changes the WHERE clause from:

WHERE
	collectionobject.`CollectionID` = 4
	AND taxon_1.`TaxonTreeDefID` IN (1)

to

WHERE
	collectionobject.`CollectionID` = 4
	AND (taxon_1.`TaxonTreeDefID` IN (1)
		OR taxon_1.`TaxonTreeDefID` IS NULL)

Checklist

  • Self-review the PR after opening it to make sure the changes look good and
    self-explanatory (or properly documented)
  • Add relevant issue to release milestone

Testing instructions

  • Create a new collection object with a species taxon determination. Note the catalog number for later.
  • Create a new collection object without any taxon determination. Note the catalog number for later.
  • Create a collection object query with a filter for the two catalog numbers and 'Determinations -> Taxon -> Species -> Full Name -> Any'. See the screen shot for the full example query.
  • See that in the query results, both of the newly created collection objects appear.

Screenshot of first CO with Taxon:
image

Screenshot of second CO without Taxon:
image

Screenshot of query with results:
image

@acwhite211 acwhite211 added the 2 - Queries Issues that are related to the query builder or queries in general label Apr 1, 2025
@acwhite211 acwhite211 added this to the 7.10.3 milestone Apr 1, 2025
@acwhite211 acwhite211 self-assigned this Apr 1, 2025
@github-project-automation github-project-automation Bot moved this to 📋Back Log in General Tester Board Apr 1, 2025
@acwhite211 acwhite211 changed the title init inclusion of null taxontreedef in query results Inclusion of null taxontreedef in query results Apr 1, 2025
@acwhite211
acwhite211 marked this pull request as ready for review April 1, 2025 18:07
@acwhite211
acwhite211 requested review from a team, CarolineDenis, emenslin and sharadsw April 1, 2025 18:08

@pashiav pashiav left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • See that in the query results, both of the newly created collection objects appear.

Looks good!
Screenshot 2025-04-02 at 12 05 19 PM

@pashiav
pashiav requested a review from a team April 2, 2025 17:06

@emenslin emenslin left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • See that in the query results, both of the newly created collection objects appear.

Looks good!

image

@acwhite211
acwhite211 merged commit de0f47d into production Apr 10, 2025
@acwhite211
acwhite211 deleted the issue-5479 branch April 10, 2025 15:12
@github-project-automation github-project-automation Bot moved this from 📋Back Log to ✅Done in General Tester Board Apr 10, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

2 - Queries Issues that are related to the query builder or queries in general

Projects

Status: ✅Done

Development

Successfully merging this pull request may close these issues.

Adding tree ranks to queries will incorrectly filter valid records

5 participants