So I've stumbled on a weird behavior, which seems ...
# lucee
d
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 treated this as saying "Make this parameter null", which generates an error:
Copy code
<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:
Copy code
<cfscript>
param name="form.thisShouldDefaultToAString" type="string" default="NULL";

writeDump(form);
</cfscript>
This seems wrong to me and is certainly misleading. Is this a documented behavior?
@zackster the problem is not specific to trycf. I see the same behavior in my dev environment (but I agree, it adds stuff to the form scope)
z
yeah i know, just was suprised
d
I wasn't sure if you thought that the problem might have been due to something trycf was doing, so I wanted to make it clear that it was not specific to trycf. Does this look like a bug to you? Or is this something documented that I've missed?
z
i pinged @micha he said "strange, i was not expecting that at all", he's looking into it
d
Thanks. I'm concerned that a string of
NULL
might have some other consequences elsewhere in the code as well. Hopefully it's unique to
cfparam
and not created weird side effects in other parts of the code.
z
can you file a bug plz?
d
Absolutely. I didn't want to file a bug if it was some documented behavior I was missing.
z
yeah best way is to always ask before filing, good stuff
z
incoming patch
d
Awesome!