tracker issue : CF-4203996

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

Error when using terniary conditional inside of <cfdocumentsection>

| View in Tracker

Status/Resolution/Reason: To Fix//BugVerified

Reporter/Name(from Bugbase): Jonathan C. / ()

Created: 01/30/2019

Components: Language

Versions: 2018

Failure Type: Non Functioning

Found In Build/Fixed In Build: 2018.0.2-beta.2 /

Priority/Frequency: Normal / All users will encounter

Locale/System: ALL / Linux

Vote Count: 1

Problem Description:

A low-level error is thrown when using a terniary conditional inside of a <cfdocumentsection> tag.

Steps to Reproduce:
<cfdocument format="PDF">
    <h1>Hello World</h1>
        <h2>Hello Section</h2>
        <cfdocumentsection marginBottom="#arrayContains( [ 'pdf' ], 'pdf' ) ? 1.6 : 1#">
            <h2>Hello Sub-Section</h2>

Actual Result:

An low-level 500 error is generated by the compiler:

(class: cfreport2ecfm1389601345, method: _factor7 signature: (Ljavax/servlet/jsp/tagext/Tag;Ljavax/servlet/jsp/JspWriter;)Ljava/lang/Object;) Expecting to find double on stack

Expected Result:

A PDF is generated and rendered

Any Workarounds:



A workaround is to use a <cfif> block to set the variable and then pass it in to the document section attribute
Comment by Jonathan C.
30159 | January 30, 2019 12:58:32 AM GMT
Hi Adobe, The issue is much bigger. Here is a repro: <cfscript> foo = true; bar = foo ? 1.2 : 2;//HTTP Error 500.0 - (class: cfmypage2ecfm1301256636, method: runPage signature: ()Ljava/lang/Object;) Unable to pop operand off an empty stack writeOutput(bar); </cfscript> What!? Verified in CF2018 Final (build 2018.0.0.310739) on Windows 10 w/ IIS. Thanks!, -Aaron
Comment by Aaron N.
30167 | February 01, 2019 10:21:34 AM GMT
+1 - Filed as CF-4203999
Vote by Aaron N.
30177 | February 02, 2019 04:46:08 AM GMT
Code to repro : {code:java} <cfset mystruct.test=true> <cfset a=mystruct.test ? 1.6 : 1> <cfoutput>#a#</cfoutput> This throws exception. The following code throws exception: <cfset mystruct.test=true> <cfset a=mystruct.test ? "1.6" : 1> <cfoutput>#a#</cfoutput> {code}  
Comment by Suchika S.
30230 | February 11, 2019 07:30:23 AM GMT
Hi Adobe, I see you've marked this ToFix. However, CF-4203999 is a more complete description of the issue. Thanks!, -Aaron
Comment by Aaron N.
30222 | February 11, 2019 08:17:29 AM GMT
Hi Suchika, Thank you very much for working on this issue. At the moment when I added my previous comment, I did not notice your comment for some reason. But, of course that is okay - I see you know very clearly what the issue is :) Also, I added a comment on CF-4203999 regarding the ticket's title (for the upcoming "Issues Fixed" list). I hope Adobe chooses a title which better summarizes the issue, since the issue is not specific to cfdocumentsection. Thanks!, -Aaron
Comment by Aaron N.
30231 | February 12, 2019 09:42:17 AM GMT