Skip to content

Commit

Permalink
fix: [DHIS2-15844] allow repeated use of d2:hasValue in a single expr…
Browse files Browse the repository at this point in the history
…ession (#1866)
  • Loading branch information
superskip authored Sep 15, 2023
1 parent 7627ca8 commit c06a640
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion d2-tracker/dhis2.angular.services.js
Original file line number Diff line number Diff line change
Expand Up @@ -2005,7 +2005,7 @@ var d2Services = angular.module('d2Services', ['ngResource'])
//d2:hasValue('variableName') to avoid the further replacement, and make sure the correct input is fed into d2:hasValue.
var avoidReplacementFunctions = ['d2:hasValue','d2:lastEventDate', 'd2:count', 'd2:countIfZeroPos', 'd2:countIfValue'];
avoidReplacementFunctions.forEach(avoidReplaceFunction => {
expression = expression.replace( new RegExp("(" + avoidReplaceFunction + "\\() *[A#CV]\\{([\\w \\-\\_\\.]+)\\}(.*)\\)" ), "$1'$2'$3\)");
expression = expression.replaceAll( new RegExp("(" + avoidReplaceFunction + "\\() *[A#CV]\\{([\\w \\-\\_\\.]+)\\}", 'g'), "$1'$2'");
});

//Check if the expression contains program rule variables at all(any curly braces):
Expand Down

0 comments on commit c06a640

Please sign in to comment.