stop queryparam casting empty string values to null, except for varchar

Description

Lucee currently casts empty strings to null, ACF doesn’t

lucee allows <cfqueryparam cfsqltype="CF_SQL_INTEGER" value="">
acf crashes <cfqueryparam cfsqltype="CF_SQL_INTEGER" value="">

Lucee’s behaviour is unexpected and confusing

https://dev.lucee.org/t/different-cfqueryparam-behavior-between-acf-and-lucee/2836

UPDATE: There is an ENV var LUCEE_QUERY_ALLOWEMPTYASNULL=TRUE to enable the old behaviour https://luceeserver.atlassian.net/browse/LDEV-5008

Environment

None

Activity

Show:

Zac Spitzer 12 August 2024 at 07:58

Pothys - MitrahSoft 8 May 2023 at 10:07
Edited

checked this ticket with lucee latest version 6.0.0.387-SNAPSHOT. Now cfqueryparam with value="" & null=false which doesn't cast empty strings to null. It throws an can't cast empty string to a number value error and the issue is solved

Michael Offner 5 May 2023 at 08:37

please give this a try

Zac Spitzer 5 May 2023 at 08:26

we’ve got this flagged as a breaking change, which means i’ll be highlighting it in the release notes / upgrade concerns

given the behaviour is now predictable and throws, the change isn’t going to cause silent failures. I don’t think we need a setting, but let’s see what feedback we get in the beta phase?

Fixed

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

Sprint

Created 1 March 2023 at 22:02
Updated 4 February 2025 at 17:13
Resolved 8 May 2023 at 10:07