fix(AppResources): default SpAppResource.description to name on creation#7985
Open
foozleface wants to merge 1 commit intospecify:mainfrom
Open
fix(AppResources): default SpAppResource.description to name on creation#7985foozleface wants to merge 1 commit intospecify:mainfrom
foozleface wants to merge 1 commit intospecify:mainfrom
Conversation
The frontend "New Resource" path constructed SpAppResource without a description, persisting NULL. Specify 6 hard-fails when opening labels backed by such rows. Mirror the backend report_runner behavior, which already defaults description to name. Refs ticket specify#824.
Iwantexpresso
requested changes
Apr 21, 2026
Contributor
Iwantexpresso
left a comment
There was a problem hiding this comment.
-
npx jest --testPathPattern CreateAppResource— 4/4 pass (3 existing + 1 new) - Manually create a new App Resource via User Tools → App Resources → New Resource and confirm
spappresource.Descriptionis non-NULL in the DB - Open the new resource as a label/report in Specify 6 and confirm it no longer crashes
jest test results
Whenever the resource created the description field for the spappresource is currently staying as null. I have tried with creating 3 different app resources so far. I am a little unsure how request changes would whirl for this pr but I assume it wouldn't hurt just placing this in as one for now
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
The "New Resource" flow in
AppResources/Create.tsxconstructs anSpAppResourcewithout adescription, so the row is persisted withDescription = NULL. The backendreport_runnercreate path already defaultsdescription = name; this PR makes the frontend match.Specify 6 hard-fails when opening a label whose underlying
spappresource.Descriptionis NULL, so any site still running S6 alongside S7 hits this immediately. Reported as Specify support ticket #824 — Grant confirmed the analysis and asked for a PR.Changes
buildNewAppResource()helper inCreate.tsx; defaultsdescription: name.trim()exportsForTests(same pattern asgetUrlin this file)description === name.trim()Note for sites running both S6 and S7
If you already have rows with
Description IS NULL, S6 will still hard-fail on them after this PR is merged — this fix only prevents new NULL rows. A one-time backfill is safe and cheap (description is a simple text label, free-form):Test plan
npx jest --testPathPattern CreateAppResource— 4/4 pass (3 existing + 1 new)spappresource.Descriptionis non-NULL in the DB