mithlond
05/27/2022, 3:38 PM<cfset local.result = getModel("personS").PMRoleUpdateProductPosition(
listToArray(arguments.rc.productIDs).map((product_id) => {
return {
product_id = arguments.product_id,
context_type = rc.context_type
};
}),
arguments.rc.contextStatus,
arguments.rc.person_id
) />
until I make some other seemingly unrelated changes somewhere else in the file, far away, like changing this
<cfif
(...
to this
<cfif (...
and this
<cfif blah>
<!--- some comment --->
to this
<cfif blah> <!--- some comment --->
Then, CF is like unhandled exception "Invalid CFML construct found on line n" complaining about the }
character on the 7th line of the first bit of code. If I refactor it a bit to this, no complaints and it runs fine:
<cfset local.productsArray = listToArray(arguments.rc.productIDs) />
<cfset local.productsWithTypes = local.productsArray.map((product_id) => {
return { product_id = arguments.product_id, context_type = rc.context_type };
}) />
<cfset local.result = getModel("personS").PMRoleUpdateProductPosition(local.productsWithTypes, arguments.rc.contextStatus, arguments.rc.person_id ) />
Why would the exact same code not have a syntax error before those unrelated, distant changes, but die once they're made?Adam Cameron
I'm wondering if it's some tokenization bug in CF itself.Probably this. It would not be the only one. And use threads pls.
mithlond
05/27/2022, 7:11 PMAdam Cameron
Adam Cameron
mithlond
05/27/2022, 7:13 PMAdam Cameron
return [ product_id = arguments.product_id, context_type = rc.context_type ];
Adam Cameron
{}
for the callback, and the return
<cfset local.result = getModel("personS").PMRoleUpdateProductPosition(
listToArray(arguments.rc.productIDs).map((product_id) => [
product_id = arguments.product_id,
context_type = rc.context_type
]),
arguments.rc.contextStatus,
arguments.rc.person_id
) />
mithlond
05/27/2022, 7:18 PMAdam Cameron
Adam Cameron
mithlond
05/27/2022, 7:20 PM