cfhtmlhead does not work with positional argument

Description

Problem Description:

cfhtmlhead( "hello world" ); //throws an error

Steps to Reproduce:

Use cfhtmlhead( "hello world" ); (Try it in TryCF.com or CFFiddle.org)

Actual Result:

CFERROR: ColdFusion was looking at the following text: )

Expected Result:

It should accept a positional parameter just like any other function.

Any Workarounds:

Used a named parameter or attributeCollection.

cfhtmlhead( text="abc" );
or
test = structnew();
test.text="123";
cfhtmlhead( attributeCollection=test );

Environment

Tested using TryCF.com

Activity

Show:

Brad Wood 8 November 2021 at 18:30

This is why I always use Lucee’s generic tag-in-script syntax, which avoids the confusion of looking like a function when it’s not one.

htmlhead text="abc";

Sadly, Adobe never supported that syntax even though Railo released theirs first. Adobe requires the silly looks-like-a-function-but-isn’t-really syntax.

Pothys - MitrahSoft 28 October 2021 at 15:10

cfhtmlhead() is not a function is a tag that allows only named parameters. If you use cfhtmlhead() in cfscript then use it like cfhtmlhead( text="abc" ); or use cfhtmlhead( attributeCollection=test ); This is not a bug in my opinion. So shall I close this ticket?

Pothys - MitrahSoft 15 February 2021 at 07:12

I've checked this ticket with lucee latest version 5.3.8.144-SNAPSHOT. cfhtmlhead with positional argument throw error in both Lucee and ACF. As Zac said cfhtmlhead is a tag, not a function. It supports only named attributes. will decide about this.

Zac Spitzer 14 February 2021 at 21:45

Fixed

Details

Assignee

Reporter

Priority

New Issue warning screen

Before you create a new Issue, please post to the mailing list first https://dev.lucee.org

Once the issue has been verified, one of the Lucee team will ask you to file an issue

Affects versions

Created 13 February 2021 at 17:44
Updated 8 November 2021 at 18:30
Resolved 8 November 2021 at 10:57

Flag notifications