Missing Else Segment of Ternary IF threw unrelated error location

Description

To summarize my site in quick detail.

It uses application.cfc's onRequest and includes my site template.

I was adding something to a page today involving a ternary if and wrote this

#(CurrentID eq SCANFORID ? " selected")#

Saved the file and left for a bit. This is just on my testing server so no harm.

I came back to an error telling me [[Invalid conditional operator}} occurring in the template handler file on the line that includes the file.

Obviously it was easy to fix, find the ternary in my file and change it to

#(CurrentID eq SCANFORID ? " selected" : "")#

Environment

Windows 10, IIS 2017 (v1709)

Activity

Show:
Pothys - MitrahSoft
December 27, 2017, 5:49 AM

I've analyzed this ticket & Confirmed lucee throw error "invalid conditional operator" While we missed the else segment. But I think that Lucee behaviour is expected, without else part in ternary operator it should throw error. ACF also does same as Lucee. Any way micha will confirm this.

Bradley Hicks
December 27, 2017, 5:53 AM

The error is valid, but Lucee is misreporting where it’s ocurring at, instead citing the line that includes the erring file.

Michael Offner
January 15, 2018, 5:10 PM
Fixed

Assignee

Michael Offner

Reporter

Bradley Hicks

Priority

Critical

Labels

None

Fix versions

Sprint

None

Affects versions