Issues

Select view

Select search mode

 

CFParam treats a default value of "NULL" as a null value

Fixed

Description

So I've stumbled on a weird behavior, which seems like a bug to me (it certainly does not match ACF behavior):

https://www.trycf.com/gist/5c8ab610df9eba0a32fbf72951d67c68/lucee5?theme=monokai

When a param uses a string value of NULL for the default attribute, Lucee seems to be treat this as saying "Make this parameter null", which generates an error:

<cfscript> param name="form.thisShouldDefaultToAString" default="NULL"; writeDump(form); </cfscript>

If you change the string from NULL to null then it works as expected. If you add a type attribute of string, then it generates an empty string:

<cfscript> param name="form.thisShouldDefaultToAString" type="string" default="NULL"; writeDump(form); </cfscript>

So it appears that the string NULL has some special meaning when used in cfparam.

Environment

Any

Details

Assignee

Reporter

Priority

Fix versions

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 5 January 2023 at 16:26
Updated 9 August 2024 at 10:52
Resolved 6 January 2023 at 12:25

Activity

Show:

Zac Spitzer6 January 2023 at 12:26

a change which caused a regression ain’t fixed yet!

Pothys - MitrahSoft6 January 2023 at 12:24

I've checked this ticket with the Lucee fixed version 6.0.0.329-SNAPSHOT. Now cfparam with default "NULL" works fine.

Flag notifications