Repository navigation
Merged
Conversation
…ion for header form setupEncDupsValidation() in mastercard.js dereferenced flowsheet.getFlowsheet(formName) without checking for undefined. This throws "Cannot read properties of undefined (reading 'encounterTypeUuid')" whenever the flowsheet header form is entered/edited, since the header form is never registered via flowsheet.addFlowsheet() (only the repeatable visit forms are) so getFlowsheet() returns undefined for it. Guard against this and skip duplicate-encounter validation for the header form, since that check only applies to the repeatable visit forms. Also bumps htmlformentryVersion to 7.3.0-SNAPSHOT to pick up the companion fix in openmrs-module-htmlformentry (HTML-894) for local verification. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
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
setupEncDupsValidation()inmastercard.jscallsflowsheet.getFlowsheet(formName)and immediately dereferences the result'sencounterTypeUuid, without checking forundefined.flowsheet.addFlowsheet()(only the repeatable visit forms are), sogetFlowsheet()returnsundefinedwhen called for the header form. SincesetupForm()in htmlformentryui'sflowsheet.jsinvokes theafterSetupFormextension hook (which callssetupEncDupsValidation) for the header form too, entering/editing the header throwsUncaught TypeError: Cannot read properties of undefined (reading 'encounterTypeUuid').htmlformentryVersionto7.3.0-SNAPSHOTto pick up the companion fix inopenmrs-module-htmlformentry(HTML-894) for local verification of a related "Enter New ART Visit" bug. This should be reverted to a released version before merge once HTML-894 is released.Test plan
TypeErrorin console🤖 Generated with Claude Code