Skip to content

Conversation

@melton-jason
Copy link
Contributor

See #6488

The Issue

When rendering an independent to-one relationship (CollectionObject -> accession, CollectionObject -> collectingEvent if shared, etc.) via Query Combo Box where the reverse relationship (Accession -> collectionObjects, CollectingEvent -> collectionObjects, etc.) was rendered as a Subview, opening the related record's form after the first time would cause Specify to internally think the related record's version of the "main" record had changed.
If the related record is saved, Specify also modifies each of the to-many side of the relationship: which triggers their version and timestamp modified to be updated. The main form version of the record is not updated, which led to the (appropriate) out-of-date error.

6488_out_of_date.mov
6488_unload_protect.mov

This PR addresses the first solution (provided below) mentioned in #6488 (comment)

Re-fetching a resource or collection of resources should not be triggering a change unless changes have actually been made to the models

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
  • Add relevant documentation (Tester - Dev)
  • Add automated tests

Testing instructions

  • Find a Independent to-many relationship (such as Accession -> collectionObjects). For the to-one side of the relationship (e.g., CollectionObject -> accession), make sure it is on the form either as a QueryComboBox or as a button and that the other table's form (e.g., Accession) has the to-many relationship back to the base table as a Subview (Accession -> collectionObjects)
    • Below is a table which contains all relationships which could cause this error to make identifying relationships easier
  • Locate or create a record of the to-one side which contains information on both sides of the relationship. For example, find a CollectionObject which is already associated with an Accession.
  • Open the related record (e.g., Accession) by using the Query Combo Box edit button or by clicking on the Subview Button (whichever the relationship is rendered as)
  • Close the related record form
  • Re-open the related record's form
  • Ensure that the save button (unload protect) is not enabled on either the related record or base record
  • Make an edit to the related record and save the related record
  • Save the base record
  • Re-open the related record's form
  • Make another edit to the related record and save the related record
  • Save the base record and ensure no out-of-date errors occur
All relationships for which the Issue can occur

To use this table, make sure the To-One Field is rendered on the Base Table form as a Query Combo Box or (Subview) Button and the form of the To-One Field has the Independent Back to Base as a Subview

Base Table To-One Field Independent Back to Base
AccessionCitation accession accessionCitations
Appraisal accession appraisals
CollectionObject accession collectionObjects
TreatmentEvent accession treatmentEvents
Division address divisions
Institution address insitutions
Accession addressOfRecord accessions
Borrow addressOfRecord borrow
ExchangeIn addressOfRecord exchangeIns
ExchangeOut addressOfRecord exchangeOuts
Loan addressOfRecord loans
RepositoryAgreement addressOfRecord repositoryAgreements
CollectionObject cataloger catalogerOf
Collector agent collectors
GroupPerson member members
Agent organization orgMembers
CollectionObject appraisal collectionObjects
AccessionAttachment attachment accessionAttachments
AgentAttachment attachment agentAttachments
BorrowAttachment attachment borrowAttachments
CollectingEventAttachment attachment collectingEventAttachments
CollectingTripAttachment attachment collectingTripAttachments
CollectionObjectAttachment attachment collectionObjectAttachments
ConservDescriptionAttachment attachment conservDescriptionAttachments
ConservEventAttachment attachment conservEventAttachments
DeaccessionAttachment attachment deaccessionAttachments
DisposalAttachment attachment disposalAttachments
DNASequenceAttachment attachment dnaSequenceAttachments
DNASequencingRunAttachment attachment dnaSequencingRunAttachments
ExchangeInAttachment attachment exchangeInAttachments
ExchangeOutAttachment attachment exchangeOutAttachments
FieldNotebookAttachment attachment fieldNotebookAttachments
FieldNotebookPageAttachment attachment fieldNotebookPageAttachments
FieldNotebookPageSetAttachment attachment fieldNotebookPageSetAttachments
GiftAttachment attachment giftAttachments
LoanAttachment attachment loanAttachments
LocalityAttachment attachment localityAttachments
AttachmentMetadata attachment metadata
PermitAttachment attachment permitAttachments
PreparationAttachment attachment preparationAttachments
ReferenceWorkAttachment attachment referenceWorkAttachments
RepositoryAgreementAttachment attachment repositoryAgreementAttachments
SpDataSetAttachment attachment spDataSetAttachments
StorageAttachment attachment storageAttachments
AttachmentTag attachment tags
TaxonAttachment attachment taxonAttachments
TreatmentEventAttachment attachment treatmentEventAttachments
CollectingEventAttr definition collectingEventAttrs
CollectionObjectAttr definition collectionObjectAttrs
PreparationAttr definition preparationAttrs
CollectionObject collectingEvent collectionObjects
CollectingEvent collectingEventAttribute collectingEvents
CollectingEvent collectingTrip collectingEvents
CollectingTrip collectingTripAttribute collectingTrips
CollectionObject collection collectionObjects
Agent collContentContact contentContacts
CollectionRelType leftSideCollection leftSideRelTypes
PickList collection pickLists
PrepType collection prepTypes
CollectionRelType rightSideCollection rightSideRelTypes
Agent collTechContact technicalContacts
SpPrincipal scope userGroups
CollectionObject collectionObjectAttribute collectionObjects
Container parent children
CollectionObject containerOwner collectionObjectKids
CollectionObject container collectionObjects
DNASequencingRun dnaPrimer dnaSequencingRuns
Extractor dnaSequence extractors
PcrPerson dnaSequence pcrPersons
Disposal deaccession disposals
ExchangeOut deaccession exchangeOuts
Gift deaccession gifts
AttributeDef discipline attributeDefs
Collection discipline collections
SpExportSchema discipline spExportSchemas
SpLocaleContainer discipline spLocaleContainers
SpPrincipal scope userGroups
Accession division accessions
Discipline division disciplines
Agent division members
SpPrincipal scope userGroups
Shipment exchangeOut shipments
CollectionObject fieldNotebookPage collectionObjects
Geography acceptedGeography acceptedChildren
Geography parent children
Locality geography localities
Geography definition treeEntries
GeographyTreeDefItem parent children
Geography definitionItem treeEntries
GeologicTimePeriod acceptedGeologicTimePeriod acceptedChildren
PaleoContext bioStrat bioStratsPaleoContext
GeologicTimePeriod parent children
PaleoContext chronosStrat chronosStratsPaleoContext
GeologicTimePeriod definition treeEntries
GeologicTimePeriodTreeDefItem parent children
GeologicTimePeriod definitionItem treeEntries
RecordSet infoRequest recordSets
Agent instContentContact contentContacts
Division institution divisions
Agent instTechContact technicalContacts
SpPrincipal scope userGroups
Collection institutionNetwork collections
Agent instTechContact contacts
ReferenceWork journal referenceWorks
LithoStrat acceptedLithoStrat acceptedChildren
LithoStrat parent children
PaleoContext lithoStrat paleoContexts
LithoStrat definition treeEntries
LithoStratTreeDefItem parent children
LithoStrat definitionItem treeEntries
DisposalPreparation loanReturnPreparation disposalPreparations
CollectingEvent locality collectingEvents
AttachmentImageAttribute morphBankView attachmentImageAttributes
CollectingEvent paleoContext collectingEvents
CollectionObject paleoContext collectionObjects
Locality paleoContext localities
AccessionAuthorization permit accessionAuthorizations
CollectingEventAuthorization permit collectingEventAuthorizations
CollectingTripAuthorization permit collectingTripAuthorizations
Preparation prepType preparations
ConservDescription preparation conservDescriptions
DisposalPreparation preparation disposalPreparations
ExchangeInPrep preparation exchangeInPreps
ExchangeOutPrep preparation exchangeOutPreps
GiftPreparation preparation giftPreparations
LoanPreparation preparation loanPreparations
Preparation preparationAttribute preparations
RecordSetItem recordSet recordSetItems
CollectionObjectCitation referenceWork collectionObjectCitations
ReferenceWork containedRFParent containedReferenceWorks
DeterminationCitation referenceWork determinationCitations
Exsiccata referenceWork exsiccatae
LocalityCitation referenceWork localityCitations
TaxonCitation referenceWork taxonCitations
Accession repositoryAgreement accessions
SpAppResourceData spAppResource spAppResourceDatas
SpReport appResource spReports
SpAppResource spAppResourceDir spPersistedAppResources
SpViewSetObj spAppResourceDir spPersistedViewSets
SpAuditLogField spAuditLog fields
SpExportSchemaItem spExportSchema spExportSchemaItems
SpExportSchemaItemMapping exportSchemaMapping mappings
SpSymbiotaInstance schemaMapping symbiotaInstances
SpLocaleItemStr containerDesc descs
SpLocaleContainerItem container items
SpLocaleItemStr containerName names
SpLocaleItemStr itemDesc descs
SpLocaleItemStr itemName names
SpExportSchemaItem spLocaleContainerItem spExportSchemaItems
SpReport query reports
SpExportSchemaItemMapping queryField mappings
SpAppResourceData spViewSetObj spAppResourceDatas
LatLonPolygon visualQuery polygons
Agent specifyUser agents
SpAppResourceDir specifyUser spAppResourceDirs
SpAppResource specifyUser spAppResources
SpQuery specifyUser spQuerys
SpTaskSemaphore owner taskSemaphores
Workbench specifyUser workbenches
WorkbenchTemplate specifyUser workbenchTemplates
Storage acceptedStorage acceptedChildren
Storage parent children
Container storage containers
Preparation storage preparations
Storage definition treeEntries
StorageTreeDefItem parent children
Storage definitionItem treeEntries
Taxon acceptedTaxon acceptedChildren
Taxon parent children
CollectingEventAttribute hostTaxon collectingEventAttributes
Determination taxon determinations
Taxon hybridParent1 hybridChildren1
Taxon hybridParent2 hybridChildren2
Determination preferredTaxon preferredTaxonOf
Taxon taxonAttribute taxons
Taxon definition treeEntries
TaxonTreeDefItem parent children
Taxon definitionItem treeEntries
WorkbenchRow workbench workbenchRows
WorkbenchDataItem workbenchRow workbenchDataItems
WorkbenchRowExportedRelationship workbenchRow workbenchRowExportedRelationships
WorkbenchRowImage workbenchRow workbenchRowImages
Workbench workbenchTemplate workbenches
WorkbenchDataItem workbenchTemplateMappingItem workbenchDataItems
TectonicUnit definition treeEntries
TectonicUnitTreeDefItem parent children
TectonicUnit definitionItem treeEntries
TectonicUnit acceptedTectonicUnit acceptedChildren
PaleoContext tectonicUnit paleoContexts

@melton-jason melton-jason added this to the 7.10.2.3 milestone May 12, 2025
@melton-jason melton-jason requested review from a team May 12, 2025 19:25
@github-project-automation github-project-automation bot moved this to 📋Back Log in General Tester Board May 12, 2025
@melton-jason melton-jason changed the base branch from production to hotfix7.10.2.1 May 12, 2025 19:28
@melton-jason melton-jason changed the title Don't incidently notify collections of resource changes when syncing Don't trigger unload protect when re-opening to-one in dialog May 12, 2025
@melton-jason melton-jason changed the title Don't trigger unload protect when re-opening to-one in dialog Don't trigger unload protect when re-opening to-one resource in dialog May 12, 2025
Copy link
Contributor

@alesan99 alesan99 left a comment

Choose a reason for hiding this comment

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

Testing instructions

  • Ensure that the save button (unload protect) is not enabled on either the related record or base record
  • Save the base record and ensure no out-of-date errors occur

Works! 👍👍👍

Tried on Collecting Events and Accessions.

chrome_fB2WnUJwPG.mp4
chrome_ID8AiCXzy4.mp4

Also seems to fix being able to save the readonly taxon parent form.

@alesan99 alesan99 requested a review from a team May 13, 2025 13:38
Copy link

@bronwyncombs bronwyncombs left a comment

Choose a reason for hiding this comment

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

  • Ensure that the save button (unload protect) is not enabled on either the related record or base record
Screen.Recording.2025-05-13.at.9.13.38.AM.mov
  • Save the base record and ensure no out-of-date errors occur
Screen.Recording.2025-05-13.at.9.14.24.AM.mov

@CarolineDenis CarolineDenis merged commit b41e3d6 into hotfix7.10.2.1 May 13, 2025
12 checks passed
@CarolineDenis CarolineDenis deleted the issue-6488 branch May 13, 2025 14:28
@github-project-automation github-project-automation bot moved this from 📋Back Log to ✅Done in General Tester Board May 13, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

Out of Date Error upon saving main form after related records are edited in a dialog

6 participants