Skip to content

Conversation

@acwhite211
Copy link
Member

@acwhite211 acwhite211 commented Nov 5, 2025

Fixes #7510
Fixes #7549

Fixes issue found in v7.11.3 testing where on the KUBirds database, the CO catalog number formatted field was displaying results as numbers without leading zeros, like 1 instead of this 000000001.

The issue introduced by recent refactoring of query-building defaults where the generated SQL for CatalogNumber fields wrapped the numeric cast expression inside IFNULL(...) rather than the raw column.

The ObjectFormatter.make_expr() method always wrapped the formatted expression in blank_nulls(...), even after _fieldformat() applied the numeric cast for CatalogNumber. After refactoring to use a fresh DefaultQueryFormatterProps(), the numeric_catalog_number flag was applied earlier, allowing the change in the generated SQL.

Here is the formatted catalog number in the query before:

IFNULL(CAST(collectionobject.`CatalogNumber` AS DECIMAL(65)), '') AS blank_nulls_1

And here it is after the changes in this PR:

IFNULL(collectionobject.`CatalogNumber`, '') AS blank_nulls_1

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

  • Use the KUBrids database
  • Open the QB for CO and run a query with catalog number formatted.
  • See that the query results for the formatted catalog number have leading zeros.

Copy link
Contributor

@Gitesh307 Gitesh307 left a comment

Choose a reason for hiding this comment

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

Looks good! Verified on KU Birds, formatted catalog numbers now keep leading zeros in query results.

Copy link
Contributor

@Iwantexpresso Iwantexpresso left a comment

Choose a reason for hiding this comment

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

Use the KUBrids database
Open the QB for CO and run a query with catalog number formatted.

  • See that the query results for the formatted catalog number have leading zeros.

Tested on KuBirds as requested, and sd_paleo It looks like the issue has persisted, I also tested it on bohart_entomology's pinned insects collection and it is at least working fine there.

@github-project-automation github-project-automation bot moved this from 📋Back Log to Dev Attention Needed in General Tester Board Nov 5, 2025
@acwhite211
Copy link
Member Author

acwhite211 commented Nov 5, 2025

Couldn't recreate the issue on sd_paleo or KUBirds for this branch. Maybe try refreshing and clearing cache?
image
image

@acwhite211 acwhite211 self-assigned this Nov 18, 2025
@CarolineDenis CarolineDenis requested review from a team and emenslin November 18, 2025 18:22
Copy link
Collaborator

@emenslin emenslin left a comment

Choose a reason for hiding this comment

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

  • See that the query results for the formatted catalog number have leading zeros.

I tried testing using KUBirds based on the testing instructions, but it has a migration error when you open CO record format. I don't know if it impacts anything, however, when I tried uploading different versions of KUBirds they all seem to have this error. I decided to check another DB (KUfish) and I was able to recreate the issue and see that it was fixed there, so I think the PR is fine, but it might be best to test on DBs other than KUBirds.

11-25_09.46.mp4

Specify 7 Crash Report - 2025-11-25T16_01_05.204Z.txt

@emenslin emenslin requested a review from a team November 25, 2025 16:02
Copy link
Member

@grantfitzsimmons grantfitzsimmons left a comment

Choose a reason for hiding this comment

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

  • Use the KUBrids database
  • Open the QB for CO and run a query with catalog number formatted.
  • See that the query results for the formatted catalog number have leading zeros.

Do I need to test anything else?

@acwhite211 acwhite211 requested a review from a team December 5, 2025 15:39
Copy link
Contributor

@Iwantexpresso Iwantexpresso left a comment

Choose a reason for hiding this comment

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

  • See that the query results for the formatted catalog number have leading Zeroes

Just tested on ku birds and it seems to be fine now! I was not able to recreate my previous issues as well!
image

Sd paleo seems to be working as expected as well!
image

My apologies for requesting the changes even though the results are working fine!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Dev Attention Needed

7 participants