Skip to content

HierarchyException when auto-increment field format for disposalNumber #6293

@bronwyncombs

Description

@bronwyncombs

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    2 - Database/SchemaIssues that are related to the underlying database and schema

    Type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions