Skip to content

fix: Error when Program Indicators reference missing attributes#3

Merged
MiquelAdell merged 1 commit intoversion-101.33.1from
fix/pi-undefined-dataelement
May 14, 2025
Merged

fix: Error when Program Indicators reference missing attributes#3
MiquelAdell merged 1 commit intoversion-101.33.1from
fix/pi-undefined-dataelement

Conversation

@MatiasArriola
Copy link
Copy Markdown

Related issue: https://app.clickup.com/t/86987atgk

After v101.33.0 when starting Capture app, an error is shown

imagen

Error log in dev console:
TypeError: programData.attributes[variableNameParts[0]] is undefined

In this case, based on the metadata config for this DHIS2 instance, It failed because of an inconsistency in some Program Indicators referencing dataElements or attributes not present in the programData.

As a workaround, I added a check to avoid the unhandled TypeError and instead logged a warning and descriptive error, while allowing the app to load.

@MiquelAdell MiquelAdell requested review from anagperal and tokland and removed request for tokland April 17, 2025 09:08
Copy link
Copy Markdown

@anagperal anagperal left a comment

Choose a reason for hiding this comment

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

thanks @MatiasArriola !! [code-only review]

@MiquelAdell MiquelAdell merged commit 92047e0 into version-101.33.1 May 14, 2025
9 of 12 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants