Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

HierarchyException when auto-increment field format for disposalNumber #6293

Open
bronwyncombs opened this issue Mar 4, 2025 · 1 comment
Labels
2 - Database/Schema Issues that are related to the underlying database and schema

Comments

@bronwyncombs
Copy link

Describe the bug

When a field format with autonumbering is defined for disposalNumber, a crash with hierarchyException error is received upon saving a record without manually entering a number. The field does enforce the specified format outside of auto-incrementation

From Mineral Resources team @ CSIRO:

In Sp7, edge version. Added the following to the field formatter xml app resource:

(and tested on v7.9.6.2)

<format system="false" name="DisposalNumber" class="edu.ku.brc.specify.datamodel.Disposal" fieldname="disposalNumber">
<autonumber>edu.ku.brc.af.core.db.AutoNumberGeneric</autonumber>
<field type="year" size="4" value="YEAR" byyear="true"/>
<field type="separator" size="1" value="-"/>
<field type="numeric" size="3" inc="true"/>
</format>

note: the same error occurs when system="true"

To Reproduce
Steps to reproduce the behavior:

  1. Add the example field format definition to the UIFormatters file in app resources
  2. Choose this format for the field in schema config
  3. Open a new disposal form
  4. Click Save
  5. See error

Expected behavior
A clear and concise description of what you expected to happen.

disposalNumber field should respect autonumbering configuration in field format set in UIFormattes file and schema config.

Screenshots
If applicable, add screenshots to help explain your problem.

Image
Screen.Recording.2025-03-04.at.2.31.18.PM.mov

Crash Report
CSIRO crash report:
Specify 7 Crash Report - 2025-02-07T06_03_24.816Z_DisposalNumber.txt

Sp testing crash report:

Specify 7 Crash Report - 2025-03-04T20_31_30.301Z.txt

Please fill out the following information manually:

  • OS: macOS
  • Browser: Chrome
  • Specify 7 Version: 7.9.6.2
  • Database Name: sp7demofish
  • Collection name: KU Fish Tissue
  • User Name: sp7demofish

Reported By
CSIRO via asana

Additional context
I tested applying the same format to other required/indexed or identifying fields for all interaction types, and disposal is the only case where this error happens.

@bronwyncombs bronwyncombs added the 2 - Database/Schema Issues that are related to the underlying database and schema label Mar 4, 2025
@bronwyncombs bronwyncombs marked this as a duplicate of #6207 Mar 4, 2025
@grantfitzsimmons
Copy link
Member

Originally reported in #6207

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
2 - Database/Schema Issues that are related to the underlying database and schema
Projects
None yet
Development

No branches or pull requests

2 participants