You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
If a dependent relationship is displayed as a Query Combo Box and the "create new resource" (plus) button is clicked, all changes to the dependent resource are lost when the save button is pressed.
When the save button is pressed on the dependent resource to save it to the parent, it triggers a set call to set the dependent resource onto the parent
One listener of the change event is useResourceValue, which wants to parse and format the newly changed dependent resource. The problem lies in that resource.get still returns the previous value of null or undefined, as the change in the resource api has not yet set the dependent resource on the parent resource.
melton-jason
changed the title
Changes to new dependent resources from Query Combo Box not initially saved
Changes to new dependent resource from Query Combo Box not initially saved
Jan 10, 2025
Describe the bug
If a dependent relationship is displayed as a Query Combo Box and the "create new resource" (plus) button is clicked, all changes to the dependent resource are lost when the save button is pressed.
issue_demo.mov
This has been an Issue since at least v7.9.6.2.
To Reproduce
Steps to reproduce the behavior:
Please fill out the following information manually:
Cause of Issue
When the save button is pressed on the dependent resource to save it to the parent, it triggers a
set
call to set the dependent resource onto the parentspecify7/specifyweb/frontend/js_src/lib/components/QueryComboBox/index.tsx
Lines 600 to 603 in 3790744
The set call is fed through the frontend resource API, which eventually triggers a change event
specify7/specifyweb/frontend/js_src/lib/components/DataModel/resourceApi.ts
Line 522 in 3790744
One listener of the change event is
useResourceValue
, which wants to parse and format the newly changed dependent resource. The problem lies in thatresource.get
still returns the previous value ofnull
orundefined
, as the change in the resource api has not yet set the dependent resource on the parent resource.specify7/specifyweb/frontend/js_src/lib/hooks/useResourceValue.tsx
Lines 239 to 244 in 3790744
specify7/specifyweb/frontend/js_src/lib/hooks/useResourceValue.tsx
Line 153 in 3790744
The text was updated successfully, but these errors were encountered: