tracker issue : CF-3777403

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

CFLOOP with simple time values no longer function

| View in Tracker

Status/Resolution/Reason: Closed/Fixed/

Reporter/Name(from Bugbase): Indy Griffiths / Indy Griffiths (Indy Griffiths)

Created: 06/17/2014

Components: Language

Versions: 11.0

Failure Type: Incorrect w/Workaround

Found In Build/Fixed In Build: CF11_Final /

Priority/Frequency: Normal / Some users will encounter

Locale/System: ALL / Windows 8.1/64bit

Vote Count: 0

Listed in the version 11.0.03.292480 Issues Fixed doc
Problem Description:
When using the CFLOOP tag in pre-CF10 code, it was possible to specify a from and to attribute that was a simple time value (e.g 08:00:00 or 19:00:00. However this seems to be broken in CF11 and is mainly a backwards compatibility issue.

Steps to Reproduce:
Simple loop that will output every time between 8am and 7:30pm in 5 minute increments. Works pre-CF11.
<cfloop from="08:00:00" to="19:30:00" index="time" step="#CreateTimeSpan(0,0,5,0)#">
	#TimeFormat(time, "hh:mm:ss")#<br>
</cfloop>

Actual Result:
Attribute validation error for CFLOOP.

The value of the FROM attribute is invalid. The value cannot be converted to a numeric because it is not a simple value. Simple values are booleans, numbers, strings, and date-time values.

Expected Result:
08:00:00
08:05:00
08:10:00
and so on...

Any Workarounds:
Use the CreateTime function. 

<cfloop from="#CreateTime(8,0,0)#" to="#CreateTime(19,30,0)#" index="time" step="#CreateTimeSpan(0,0,5,0)#">
	#TimeFormat(time, "hh:mm:ss")#<br>
</cfloop>

----------------------------- Additional Watson Details -----------------------------

Watson Bug ID:	3777403

External Customer Info:
External Company:  
External Customer Name: indy-griffiths
External Customer Email:  
External Test Config: My Hardware and Environment details:

ColdFusion 11 Standard

Windows 8.1

16GB RAM

Attachments:

Comments:

I'm seeing this too. It's a parser bug by the looks of it, as this variation works fine: <cfset startTime = "08:00:00"> <cfset endTime = "10:03:00"> <cfloop from="#startTime#" to="#endTime#" index="time" step="#CreateTimeSpan(0,0,5,0)#"> <cfoutput>#time#: #TimeFormat(time, "hh:mm:ss")# (#dateadd("s", 0, time)#)</cfoutput><br> </cfloop> -- Adam
Comment by External U.
11858 | June 18, 2014 02:21:36 AM GMT
We fixed bug #CF-3712010 with isValid("integer") which was considering dates as numbers. We don't allow that now and that caused this regression. Workaround:- Set strictnumbervalidation to false in Application.cfc or cfapplication tag.
Comment by Himavanth R.
11859 | August 19, 2014 02:27:38 AM GMT
Verified this is fixed in CF11 Update 3. #CF-3429216 still isn't fixed tho. Will follow-up on that ticket. Thanks!, -Aaron
Comment by External U.
11860 | November 06, 2014 09:26:54 PM GMT