Title:
[ANeff] Bug for: thread attribute variables unusable in cfhtmltopdf/cfdocument header/footer
| View in TrackerStatus/Resolution/Reason: Closed/Fixed/
Reporter/Name(from Bugbase): Aaron Neff / Aaron Neff (Aaron Neff)
Created: 02/20/2016
Components: Document Management
Versions: 11.0
Failure Type:
Found In Build/Fixed In Build: CF11_Final /
Priority/Frequency: Normal / Some users will encounter
Locale/System: English / Platforms All
Vote Count: 0
thread attribute variables unusable in cfhtmltopdf/cfdocument header/footer unless local-scoped first
----------------------
cfhtmltopdfitem repro:
----------------------
<cfscript>
mySimpleValue = 1;
myArray = [variables.mySimpleValue];
myStruct = {mySimpleValue=variables.mySimpleValue};
thread action="run" name="myThread#variables.mySimpleValue#" mySimpleValue=variables.mySimpleValue myArray=variables.myArray myStruct=variables.myStruct {
cfhtmltopdf(name="THREAD.myPDF") {
//example 1
cfhtmltopdfitem(type="header") {writeOutput(ATTRIBUTES.mySimpleValue);}//throws: "An error has occurred while retrieving content for setting Header/Footer."
/*var foo = ATTRIBUTES.mySimpleValue;
cfhtmltopdfitem(type="header") {writeOutput(foo);}*///workaround 1
//example 2
//cfhtmltopdfitem(type="header") {writeOutput(ATTRIBUTES.myArray[1]);}//throws: "An error has occurred while retrieving content for setting Header/Footer."
/*var foo = ATTRIBUTES.myArray[1];
cfhtmltopdfitem(type="header") {writeOutput(foo);}*///workaround 2
//example 3
//cfhtmltopdfitem(type="header") {writeOutput(ATTRIBUTES.myStruct.mySimpleValue);}//throws: "An error has occurred while retrieving content for setting Header/Footer."
/*var foo = ATTRIBUTES.myStruct.mySimpleValue;
cfhtmltopdfitem(type="header") {writeOutput(foo);}*///workaround 3
writeOutput(ATTRIBUTES.mySimpleValue & ' | ' & ATTRIBUTES.myArray[1] & ' | ' & ATTRIBUTES.myStruct.mySimpleValue);
}
}
threadJoin();
for(item in CFTHREAD) {
if(CFTHREAD[item].keyExists("error")) {
writeDump(CFTHREAD[item].error);
}
}
</cfscript>
Actual result: Error thrown (see comments) if thread attribute variable is directly referenced inside cfhtmltopdfitem body
Expected result: No error thrown when thread attribute variable is directly referenced inside cfhtmltopdfitem body
----------------------
cfdocumentitem repro:
----------------------
<cfscript>
mySimpleValue = 1;
myArray = [variables.mySimpleValue];
myStruct = {mySimpleValue=variables.mySimpleValue};
thread action="run" name="myThread#variables.mySimpleValue#" mySimpleValue=variables.mySimpleValue myArray=variables.myArray myStruct=variables.myStruct {
cfdocument(format="pdf", name="THREAD.myPDF") {
//cfdocumentitem(type="header") {writeOutput(ATTRIBUTES.mySimpleValue);}//throws: "Element MYSIMPLEVALUE is undefined in ATTRIBUTES."
/*var foo = ATTRIBUTES.mySimpleValue;
cfdocumentitem(type="header") {writeOutput(foo);}*///workaround
//cfdocumentitem(type="header") {writeOutput(ATTRIBUTES.myArray[1]);}//throws: "Element MYARRAY is undefined in ATTRIBUTES."
/*var foo = ATTRIBUTES.myArray[1];
cfdocumentitem(type="header") {writeOutput(foo);}*///workaround
//cfdocumentitem(type="header") {writeOutput(ATTRIBUTES.myStruct.mySimpleValue);}//throws: "Element MYSTRUCT.MYSIMPLEVALUE is undefined in ATTRIBUTES."
/*var foo = ATTRIBUTES.myStruct.mySimpleValue;
cfdocumentitem(type="header") {writeOutput(foo);}*///workaround
writeOutput(ATTRIBUTES.mySimpleValue & ' | ' & ATTRIBUTES.myArray[1] & ' | ' & ATTRIBUTES.myStruct.mySimpleValue);
}
}
threadJoin();
for(item in CFTHREAD) {
if(CFTHREAD[item].keyExists("error")) {
writeDump(CFTHREAD[item].error);
}
}
</cfscript>
Actual result: Error thrown (see comments) if thread attribute variable is directly referenced inside cfdocumentitem body
Expected result: No error thrown when thread attribute variable is directly referenced inside cfdocumentitem body
----------------------------- Additional Watson Details -----------------------------
Watson Bug ID: 4120116
External Customer Info:
External Company:
External Customer Name: Aaron Neff
External Customer Email:
Attachments:
Comments: