From 4f2c0c849567c1ec5897bb94e3bd93a6883dd031 Mon Sep 17 00:00:00 2001 From: CF Mitrah Date: Thu, 25 Jan 2024 11:58:17 +0530 Subject: [PATCH] Added a fix in returnFormat is missing from getMetaData() for LDEV-4783 --- .../lucee/runtime/type/util/ComponentUtil.java | 1 + test/tickets/LDEV4783.cfc | 17 +++++++++++++++++ 2 files changed, 18 insertions(+) create mode 100644 test/tickets/LDEV4783.cfc diff --git a/core/src/main/java/lucee/runtime/type/util/ComponentUtil.java b/core/src/main/java/lucee/runtime/type/util/ComponentUtil.java index 82a5b5c4fe..327aca301a 100755 --- a/core/src/main/java/lucee/runtime/type/util/ComponentUtil.java +++ b/core/src/main/java/lucee/runtime/type/util/ComponentUtil.java @@ -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(); diff --git a/test/tickets/LDEV4783.cfc b/test/tickets/LDEV4783.cfc new file mode 100644 index 0000000000..2129ad5fd7 --- /dev/null +++ b/test/tickets/LDEV4783.cfc @@ -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 'testing'; + } + +} \ No newline at end of file