Skip to content

Commit

Permalink
Don't double render load method fieldcapture#2940
Browse files Browse the repository at this point in the history
  • Loading branch information
chrisala committed Jul 28, 2023
1 parent 844b6cd commit 4ca73f3
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -268,7 +268,10 @@ class ModelJSTagLib {
if (requiresMetadataExtender(mod)) {
out << INDENT*4 << "${ctx.propertyPath}['${mod.name}'].load(${value});\n"
}
out << INDENT*4 << "${ctx.propertyPath}['${mod.name}'](${value});\n"
else {
out << INDENT*4 << "${ctx.propertyPath}['${mod.name}'](${value});\n"
}

}
}
else if (mod.dataType in ['image', 'photoPoints', 'audio', 'set']) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -243,7 +243,7 @@ class ModelJSTagLibSpec extends Specification implements TagLibUnitTest<ModelJST
tagLib.renderInitialiser(ctx)

then:
compareWithoutWhiteSpace("data['test'].load(ecodata.forms.orDefault(data['test'],undefined));data['test'](ecodata.forms.orDefault(data['test'],undefined));", actualOut.toString())
compareWithoutWhiteSpace("data['test'].load(ecodata.forms.orDefault(data['test'],undefined));", actualOut.toString())
}

def "Input data is null/undefined checked before calling loadData() on SpeciesViewModel"() {
Expand Down

0 comments on commit 4ca73f3

Please sign in to comment.