CFCONTINUE In a "Grouped Loop" does not behave as expected

Description

I expect the output from the included code to be:
bar
Give
You
Up

What actually happens: It actually returns nothing. Perhaps cfcontinue in this setting does some sort of implied cfbreak?

<cfset myQry = queryNew( 'id,cat,name', 'integer,string,string', [ {"id":1, "cat":"foo", "name":"Never"}, {"id":2, "cat":"foo", "name":"Gonna"}, {"id":3, "cat":"bar", "name":"Give"}, {"id":4, "cat":"bar", "name":"You"}, {"id":5, "cat":"bar", "name":"Up"} ]) /> <cfloop query="#myQRY#" group="cat" > <cfif myQRY.cat eq 'foo'> <cfcontinue /> </cfif> <h2>#myQRY.cat#</h2><br/> <cfloop > #myQRY.name#<br/> </cfloop> </cfloop>

Environment

Lucee (5.2.7.62)
MySQL (5.7.22)
Java (1.8.0_171)
Linux (4.9.87-linuxkit-aufs)

Activity

Show:

Brian Ramsey 22 October 2020 at 00:13

This has caught us out as well… is it likely to get fixed?

Jade Steffensen 2 April 2020 at 01:50

Any updates on this issue?

Pothys - MitrahSoft 7 June 2018 at 15:49

I've added test case for this ticket & confirmed the issue happened on lucee. If we use cfcontiune in grouped query it skips entire loop instead skip the iteration. Without the group query column it working fine. Issue happened only when we use query with group attribute

Pull request: https://github.com/lucee/Lucee/pull/515

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 6 June 2018 at 19:23
Updated 23 July 2022 at 10:13

Flag notifications