Error in Data Entry Form when More Than 50 Validation Rules Are Linked (v2.42.0)

Hello DHIS2 Community,

Let me share my very first experience with DHIS2 :blush:
I started working on version 2.41.3 just three weeks ago, and I’ve already learned so much — the DHIS2 ecosystem is really impressive and exciting! Just as I was starting to get comfortable, version 2.42.0 was released… and :collision: I jumped in to test the new features right away.

Everything went well, until I encountered a blocking issue when using data validation in the aggregate data entry form. Specifically:

:red_circle: When I click on “Run validation” in the data entry form, and more than 50 validation rules are linked to the data set, the interface crashes with the following error in the browser console:

TypeError: Cannot read properties of undefined (reading 'importance')

What’s surprising is that in version 2.41.3, I had over 460 validation rules and everything worked perfectly. So I thought: humm… maybe something is wrong with my rules? I tested them block by block (20, 30, up to 60), and all of them imported and worked fine — no issues.

That’s when I dug deeper — I opened the DevTools → Network tab, and boom :collision:, I saw this API call:

{
  pager: { page: 1, total: 96, pageSize: 50 },
  validationRules: [...]
}

That’s when things clicked. My assumption is that the frontend only processes the first 50 validation rules (page 1), but tries to render all of them linked to the dataset. When it reaches a rule that hasn’t been loaded (e.g., from page 2), it hits undefined — hence the crash

In short:

  • :white_check_mark: DHIS2 version used: 2.42.0
  • :white_check_mark: More than 50 validation rules = JavaScript error in aggregate data entry screen
  • :white_check_mark: Under 50 rules: everything works fine
  • :white_check_mark: In 2.41.x, I had 460+ rules without any issue

My questions to the community:

:backhand_index_pointing_right: Is there a way to disable pagination (e.g., paging=false) or increase the pageSize for the /validationRules resource in the UI?
:backhand_index_pointing_right: Is this value configurable somewhere in DHIS2 2.42 system settings?
:backhand_index_pointing_right: And if pagination is removed, could it negatively impact performance?

Thanks so much for your help :folded_hands: — I’m new here, but I’m learning a lot and absolutely loving the DHIS2 ecosystem, even with its little challenges :blush:

2 Likes

Thanks @manouher. Welcome to the DHIS2 community! Glad to hear that you’ve been enjoying using DHIS2 :tada:.

Sorry for the problems with data validation rules in the aggregate data entry app. Thank you for looking into and reporting it back to us. We’ll take a look and see if we can replicate/fix this. If we have any questions we’ll let you know.

2 Likes