_counter does not increment in rendering query-based view collections

Description

The _counter variable does not increment because the code uses recordcount outside the context of a query-based loop, so it's always 1.

The following line in coldbox.system.web.Renderer


Should instead be:

That said, I actually think we should take this opportunity (since no one has apparently every used this feature) and return each collection pivot as a struct representing that query row. collection.column is much better than collection.column[ _counter ]. Lucee has native for/in looping that returns query rows as a struct, but ACF would require a bit of looping to build it I think.

Gliffy Diagrams

Activity

Show:

Sana UllahFebruary 12, 2016 at 9:37 PM
Edited

Added feature as Brad like

Rendering query-based view collections and collection will be treated as struct in view files.

Pull Request

https://github.com/ColdBox/coldbox-platform/pull/253

Luis MajanoSeptember 17, 2015 at 6:09 PM
Edited

Agreed

Brad WoodSeptember 17, 2015 at 3:17 PM

What are you thoughts though on changing the behavior slightly as described in the ticket to be a bit more intuitive?

Luis MajanoSeptember 17, 2015 at 3:10 PM

Since this is an easy ticket. Just go for it and fix it

Fixed
Pinned fields
Click on the next to a field label to start pinning.

Details

Assignee

Reporter

Original estimate

Time tracking

No time logged1h remaining

Components

Fix versions

Priority

Sentry

Created September 17, 2015 at 2:47 PM
Updated February 27, 2016 at 10:28 PM
Resolved February 27, 2016 at 10:28 PM