tracker issue : CF-4110354

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

CFM templates do not parse == and/or != operators

| View in Tracker

Status/Resolution/Reason: Closed/Fixed/Fixed

Reporter/Name(from Bugbase): Luis Majano / Luis Majano (Luis Majano)

Created: 01/25/2016

Components: Language

Versions: 2016,11.0,10.0

Failure Type: Enhancement Request

Found In Build/Fixed In Build: Final / 2018,0,0,305856

Priority/Frequency: Normal / All users will encounter

Locale/System: English / Linux All

Vote Count: 8

Problem Description:
CFM templates do not parse == and/or != operators.  This works on Lucee.

Steps to Reproduce:

{code:java}
<cfif thisContent.getContentType() == "page">`
{code}

Actual Result:

Expected Result:

Any Workarounds:
Changing to legacy eq and neq

----------------------------- Additional Watson Details -----------------------------

Watson Bug ID:	4110354

External Customer Info:
External Company:  
External Customer Name: Luis Majano
External Customer Email:  
External Test Config: My Hardware and Environment details:

Attachments:

Comments:

Luis notes "This works on Lucee" but it's worth emphasizing that this has worked on Railo (and Lucee) for _many_ years.
Comment by External U.
4855 | January 25, 2016 05:51:45 PM GMT
This definitely should be considered seriously. After writing most code inside cfscript tags and/or script based CFCs this usage has become second nature. If you forget about the incompatibility for tag based conditionals in a .cfm template or tag based CFC the error thrown is very generic and un-helpful.
Vote by External U.
4857 | January 25, 2016 11:24:37 PM GMT
Should be handled. All operators should be... including > which one might think would confuse the parser (given it's also the character for the end of a tag, but the parser should be cleaver enough to understand the context of the usage. That said, not sure this is a *bug* rather than an enhancement request?
Vote by External U.
4858 | January 26, 2016 04:28:50 AM GMT
Be consistent, save time
Vote by External U.
4859 | January 26, 2016 11:26:17 AM GMT
Stumbled over this many times.
Vote by External U.
4860 | January 26, 2016 11:27:28 AM GMT
Thank you!
Comment by Sean C.
4856 | October 04, 2017 04:44:24 PM GMT