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?mithlond
05/27/2022, 3:39 PMmithlond
05/27/2022, 3:39 PMmithlond
05/27/2022, 3:40 PMmithlond
05/27/2022, 3:41 PMmithlond
05/27/2022, 3:41 PMsknowlton
05/27/2022, 3:42 PMsknowlton
05/27/2022, 3:42 PMJason Ryan
05/27/2022, 5:32 PMryanguill
log
function is linked from the cflog
page is humorous to me https://cfdocs.org/cflog 😄James Vince
05/31/2022, 3:16 PMchris_hopkins
05/31/2022, 3:26 PMFormiko
05/31/2022, 4:20 PMSteve
05/31/2022, 5:44 PMvar findResponse = this.findOne( query={ "_id": "mid:#mid#[invalidkey]" } );
application.utilities.debug( module="daoI4goV5.getMerchant", text="Find #mid#", data=findResponse );
The debug line threw an exception because findResponse did not exist. Is this intentional and is there a best practice for handling this, meaning "try/catch", "isdefined()", "isnull()" (I'm not sure if the last even works, just throwing it out there)?Jason Ryan
06/01/2022, 3:22 PMonRequestStart()
hook in Application.cfc
. Is it possible? When I output form
it is just an empty struct ☹️David Rogers
06/01/2022, 4:14 PMself
a keyword or scope or otherwise magic identifier?jakobward
06/01/2022, 11:32 PMgavinbaumanis
06/02/2022, 4:32 PManswerStr = {
"Value" = "Value-1",
"Description" = "Description-1"
};
questionsStruct["Q1"] = answerStr;
answerStr = {
"Value" = "Value-2",
"Description" = "Description-2"
};
questionsStruct["Q2"] = answerStr;
Now I want the following outcome in my table
<tr>
<td>Q1</td>
<td>Value-1</td>
<td>Description-1</td>
</tr>
<tr>
<td>Q2</td>
<td>Value-2</td>
<td>Description-2</td>
</tr>
I have tried with the following (and so many other flavours....
DOT notaion
Square Brackets without DOTS / with DOTS / with Quotes / without Quotes...
I just can't seem to get it to output the actual contents of the structs
I can get the contents of the TD cell to look like the string literal; aQuestion.Q1.Value
- but not what it should evaluate to....
I tried wrapping the contents in DE()
, I tried saveContent()
....
i=0;
cfloop(collection=questionsStruct item="aQuestion"){
i++;
writeOutput('
<tr>
<td>Q#i#</td>
<td>aQuestion.Q#i#.#Value#</td>
<td>Q#i#.Description</td>
</tr>
');
}
Anyway - if someone wouldn't mind helping me out - I'd really appreciate it!Brian
06/02/2022, 6:25 PMDaniel Mejia
06/03/2022, 3:44 AMgavinbaumanis
06/05/2022, 8:18 AMPeter Hoopes
06/06/2022, 2:38 PMgsr
06/06/2022, 6:16 PMmithlond
06/06/2022, 6:46 PMgsr
06/07/2022, 11:44 AMgsr
06/07/2022, 11:45 AMgsr
06/07/2022, 11:45 AMaaronstoddard
06/07/2022, 1:04 PMMarco
06/07/2022, 1:28 PMMarco
06/07/2022, 1:44 PM