tracker issue : CF-4018168

select a category, or use search below
(searches all categories and all time range)
Title:

ArrayAppend ignores the merge param when appending arrays when the 2nd "array" is from a webservice

| View in Tracker

Status/Resolution/Reason: Closed/Fixed/

Reporter/Name(from Bugbase): David Maggard / David Maggard (David Maggard)

Created: 07/08/2015

Components: Web Services, General

Versions: 11.0

Failure Type:

Found In Build/Fixed In Build: CF11_Final /

Priority/Frequency: Normal / Some users will encounter

Locale/System: English / Win 2012 Server x64

Vote Count: 1

Listed in the version 2016.0.0.297996 Issues Fixed doc
Verification notes: verified_fixed on September 08, 2019 using build 2016.0.01.298513
Problem Description:  ArrayAppend ignores the merge param when appending arrays when the 2nd "array" is from a webservice

Steps to Reproduce:  Make a webservice call that returns an array a part of the result, try to use arrayappend to append the response array to an existing array variable with the merge param=true

Actual Result:  The array object is added as a new single element irregardless of the merge param

Expected Result:  The elements from the 2nd array added as elements to the first array

Any Workarounds:  ArrayAppend(CFArray, ListToArray(ArrayToList(WSArray)), 1)

----------------------------- Additional Watson Details -----------------------------

Watson Bug ID:	4018168

External Customer Info:
External Company:  
External Customer Name: David
External Customer Email:  
External Test Config: My Hardware and Environment details:

Attachments:

Comments:

My guess is that CF isn't seeing the webservice "array" as a regular CF array and so it is ignoring the merge param ( from docs: "If value is not an array this argument is ignored." )
Comment by External U.
6765 | July 08, 2015 12:12:33 PM GMT
David can you provide a repro case for this? (http://sscce.org/). Also, you can test your own theory by checking the Java type of the miscreant array by calling .getClass().getName() on it. That might help troubleshooting.
Comment by External U.
6766 | July 31, 2015 12:21:34 AM GMT
When a web service returns array, the client side recieves it as Object[]. Not as ColdFusion's Array representation. So ArrayAppend was just adding the whole Object[] as an element in the dest array. Changing the behavior in web service client to create Array from Object[] and return will introduce backward compatibility issue. Client side code already might be handling the return value as Object[] and modifying the behavior would result in rework in the client side code. Now this functionality is added to ArrayAppend functionality. Now we are taking care if the second argument to add is an Object[]. If it is an Object[], we are correctly merging Object[] into destination Array. Now also, there is a behavioral change, where Object[] was previously added to the destination array as single element. But now the Object[] is merged into destination array. But this feels to be correct behavior.
Comment by Paul N.
6767 | September 21, 2015 06:37:34 AM GMT
+1 - And the "now the Object[] is merged into destination array" seems like the correct behavior to me as well
Vote by External U.
6768 | September 23, 2015 12:45:40 AM GMT
Hi Adobe, I've verified this is fixed in CF2016 Update 1 (build 2016.0.01.298513). Thanks!, -Aaron
Comment by Aaron N.
31310 | September 08, 2019 08:28:54 AM GMT