tracker issue : CF-4198320

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

[ANeff] Bug for: include does not support runonce

| View in Tracker

Status/Resolution/Reason: Closed/Fixed/HaveNewInfo

Reporter/Name(from Bugbase): Aaron Neff / Aaron Neff ()

Created: 02/08/2017

Components: Documentation, Language, CFSCRIPT

Versions: 2016

Failure Type:

Found In Build/Fixed In Build: 2016.0.01.298513 / docs

Priority/Frequency: Normal /

Locale/System: / Win All

Vote Count: 0

include does not support runonce

Repro:

index.cfm
--------------------------------------------
cfinclude(template="myinclude.cfm", runonce=false);//works, good
cfinclude(template="myinclude.cfm", runonce=true);//works, good
include "myinclude.cfm" false;//fails, bad
include "myinclude.cfm" true;//fails, bad

myinclude.cfm
--------------------------------------------
a

Actual result: exception

Expected result: aa

If the CF9 language enhancements are going to be supported, then they need to be maintained.

The include keyword should probably support named parameters. Example:
--------------------------------------------
include template="myinclude.cfm" runonce=false;
--------------------------------------------

Attachments:

Comments:

Aaron, Can you try this syntax : include "myinclude.cfm" runonce=true; With CF 2016, it worked fine for me.
Comment by Poonam J.
1226 | February 09, 2017 08:28:53 AM GMT
Hi Poonam, AHA! (yes, I just confirmed that works) So, that would be a documentation bug then. That syntax is not documented here: https://helpx.adobe.com/coldfusion/developing-applications/the-cfml-programming-language/elements-of-cfml/tags.html Additionally, that is an odd syntax (an operator, followed by a positional parameter, followed by a named parameter). No wonder ppl get confused =P I'll log an ER for include to also accept all its parameters as name="value" pairs (just like how param was updated in the same manner). Example: include template="myinclude.cfm" runonce=true; Thanks!, -Aaron
Comment by Aaron N.
1227 | February 10, 2017 05:19:51 AM GMT
Filed CF-4198331 to allow the include operator to accept all attributes as name/value, just like the param operator was updated to allow. There needs to be a well-planned/consistent direction for adding attributes to tag operators. Thanks!, -Aaron
Comment by Aaron N.
1228 | February 10, 2017 05:54:45 AM GMT
Thanks Aaron! We will document the missing part. Saurav, passing the bug to you.Please document the syntax for Include.
Comment by Poonam J.
27556 | February 13, 2017 09:13:15 AM GMT