Skip to content

Commit

Permalink
Added a fix in returnFormat is missing from getMetaData() for LDEV-4783
Browse files Browse the repository at this point in the history
  • Loading branch information
cfmitrah committed Jan 25, 2024
1 parent d335289 commit 4f2c0c8
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -808,6 +808,7 @@ public static Struct getMetaData(PageContext pc, UDFPropertiesBase udf, Boolean
else if (format == UDF.RETURN_FORMAT_PLAIN) func.set(KeyConstants._returnFormat, "plain");
else if (format == UDF.RETURN_FORMAT_JSON) func.set(KeyConstants._returnFormat, "json");
else if (format == UDF.RETURN_FORMAT_SERIALIZE) func.set(KeyConstants._returnFormat, "cfml");
else if (format == UDF.RETURN_FORMAT_XML) func.set(KeyConstants._returnFormat, "xml");

FunctionArgument[] args = udf.getFunctionArguments();
Array params = new ArrayImpl();
Expand Down
17 changes: 17 additions & 0 deletions test/tickets/LDEV4783.cfc
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
component extends = "org.lucee.cfml.test.LuceeTestCase" {

function run( testResults, testBox ){
describe( "Testcase for LDEV-4783", function(){
it( title="check for 'xml' returnFormat", body=function( currentSpec ) {
var meta = getMetadata(this.returnXML);
expect(structKeyExists(meta, "returnFormat")).toBe(true);
expect(meta.returnFormat).toBe("xml");
});
});
}

remote function returnXML() returnFormat="xml"{
return '<root><item>testing</item></root>';
}

}

0 comments on commit 4f2c0c8

Please sign in to comment.