• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
1

cfif difference 2016 Dev vs 2016 Enterprise

Community Beginner ,
Oct 13, 2017 Oct 13, 2017

Copy link to clipboard

Copied

Found a minor issue with running 2016 Enterprise (update 5) on 2016 Win Server, versus 2016 Dev (update 5) on Win 10.

the cfif construct <cfif variable is "something"> or <cfif variable is not "something"> while was working in Dev 2016 fine, and earlier editions of CF, does not function on CF 2016 Enterprise.

Workaround was to convert the Is and is not to EQ and NEQ.

Not sure why there is a difference between the two platforms, but posting it as an awareness.

Has anyone else seen this behavior?

Views

1.6K

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

Community Beginner , Oct 19, 2017 Oct 19, 2017

Good news on this, it appears to be a non issue.

What was happening is the CDB application had a custom enforce SSL written, which was failing on the new server (Kept redirecting to itself)   When I had added the debug display before the CFIF which worked, and After which did not, it appears that the debug display (even with an abort) was being overridden by the redirect <cflocation> which was after the cfdump and abort.

This made it appear as if the cfif was having the issue, when it actually

...

Votes

Translate

Translate
Guide ,
Oct 16, 2017 Oct 16, 2017

Copy link to clipboard

Copied

I can't think of a reason why there would be a difference, either.  But could you post an actual example line of code where you are seeing the difference in behavior?  I'd like to see the value you on the right of the IS or IS NOT operator, and maybe the value that is in the variable itself.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Oct 19, 2017 Oct 19, 2017

Copy link to clipboard

Copied

Added code and more explanations of what I am seeing

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Advocate ,
Oct 17, 2017 Oct 17, 2017

Copy link to clipboard

Copied

You would have to show the exact code being used and variables being passed. The Dev edition is actually the same as the Enterprise addition. The only difference is the restrictions in place for connections etc. Otherwise its exactly the same engine.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Oct 18, 2017 Oct 18, 2017

Copy link to clipboard

Copied

Did you get an error or an unexpected result? If an error, what does the error message say?

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Oct 19, 2017 Oct 19, 2017

Copy link to clipboard

Copied

No errors, the cfif was inside a taglib member used by all pages, and when the offending cfif was hit it simply stopped processing, and a blank page was sent to the browser.

Here is the code which did not work.  I tracked it down to this specific if clause using <cfdump var="#session#"><cfabort>.  A cfdump before the is "start" would render, where as just after would see the blank page.  Changing the cfif to <cfif thisTag.executionMode eq "start"> and it worked again.  With out the <cfabort> the first cfdump would not render either.

I found nothing like a crash or error in any of the log files, or anything which would explain what the problem might be.

<!--- Main layout tag for CDB Application --->

<!--- AMHCS-417 Change for force the bypass of any compatibility settings for IE
      and change doct type htmp tags for new browsers --->

<cfheader name="X-UA-Compatible" value="IE=edge" />

<cfsetting enablecfoutputonly=true>

<cfparam name="attributes.bodyClass" default="default" />


<cfif thisTag.executionMode is "start">

<!--- Redirect if not SSL and NOT local dev environment --->
<cfif not cgi.server_port_secure and cgi.host neq "127.0.0.1:8500" AND cgi.HTTP_HOST NEQ "localhost">
  <!--- Redirect --->
  <cfset newurl = cgi.host&cgi.script_name&"?"&cgi.query_string>
  <cflocation url="https://#newurl#" />
</cfif>

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Oct 19, 2017 Oct 19, 2017

Copy link to clipboard

Copied

darreng51843236  wrote


<!--- Redirect if not SSL and NOT local dev environment --->
<cfif not cgi.server_port_secure and cgi.host neq "127.0.0.1:8500" AND cgi.HTTP_HOST NEQ "localhost">
  <!--- Redirect --->
  <cfset newurl = cgi.host&cgi.script_name&"?"&cgi.query_string>
  <cflocation url="https://#newurl#" />
</cfif>

This code depends on the environment. In all probability, therefore, it accounts for the difference in behaviour that you observe between ColdFusion 2016 Enterprise (update 5) on 2016 Win Server and ColdFusion 2016 Dev (update 5) on Win 10. If you delete or comment out all the environment variables, chances are that you wont see any IS/EQ difference.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guide ,
Oct 19, 2017 Oct 19, 2017

Copy link to clipboard

Copied

I'm not sure if BKBK is correct or not (note that if the OP actually changes the bolded line in his code per post #4 above it seems to work).

Might be worth seeing if Adobe can reproduce this - reach out to cfinstal@adobe.com.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Oct 19, 2017 Oct 19, 2017

Copy link to clipboard

Copied

LATEST

Good news on this, it appears to be a non issue.

What was happening is the CDB application had a custom enforce SSL written, which was failing on the new server (Kept redirecting to itself)   When I had added the debug display before the CFIF which worked, and After which did not, it appears that the debug display (even with an abort) was being overridden by the redirect <cflocation> which was after the cfdump and abort.

This made it appear as if the cfif was having the issue, when it actually was not.

One of our other CF developers says they have seen this behavior before on CF9 with a cfdump/cfabort followed by a cflocation.

Appreciate all the feedback people gave on this.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Resources
Documentation