<p>I am trying to eager load an asset field that contains 4 images.</p>

<p>When I originally set my entries the order was not affected as written below:</p>

<pre><code>{% set products = craft.entries.section('products') %}
</code></pre>

<p>I then went and changed my <code>set</code> to leverage eager loading and upon doing so the order of the images was pretty much randomized throughout the template:</p>

<pre><code>{% set products = craft.entries({
    section: 'products',
    with: [
        ['productImages', {
        withTransforms: ['small']
        }],
        'colorSelection']
}) %}
</code></pre>

<p>I then tried to add an order param next to <code>withTransforms</code> which did not have any effect either.</p>

<p>Is this a known issue?</p>

<p>UPDATE:</p>

<pre><code>    &lt;li
        data-left="{{product.productImages[1].getUrl('small')}}"
        data-center="{{product.productImages[0].getUrl('small')}}"
        data-right="{{product.productImages[2].getUrl('small')}}"
        class="product"
    &gt;
        &lt;a href="{{product.url}}"&gt;
            &lt;img class="product-image" src="{{product.productImages[0].getUrl('small')}}" alt=""&gt;
            &lt;h4&gt;{{gender}} - {{product.displayTitle}}&lt;/h4&gt;
            &lt;span&gt;{{product.price}}&lt;/span&gt;
        &lt;/a&gt;
    &lt;/li&gt;
</code></pre>

<p>Is how we are templating out each entry. Both provide a different order of assets.</p>

CC BY-SA 3.0
2016-03-16T03:34:14.910Z
I'm not able to reproduce what you're seeing in my test case.  Can you update the question to show how you're displaying the images?
Brad Bell
CC BY-SA 3.0
2016-03-16T12:43:08.433Z
@BradBell updated it as requested.
mcclaskiem
CC BY-SA 3.0
2016-03-16T17:21:33.977Z
Comes out in the proper fixed order with that template code on my end.     ¯\_(ツ)_/¯
Brad Bell
CC BY-SA 3.0
2016-03-17T20:13:21.500Z
@BradBell I'm seeing something similar in one of our builds. Can we send a support ticket? Or what's the best way to troubleshoot it?
Rob Erskine
CC BY-SA 3.0
2016-03-17T21:48:46.193Z
@RobErskine sure, shoot a database backup and template we can reproduce with over to support@craftcms.com
Brad Bell
CC BY-SA 3.0
2016-04-05T11:40:39.877Z
This bug was fixed in [Craft 2.6.2778](https://craftcms.com/changelog#build2778).
Brandon Kelly
<entries><assets><order><eager-loading>
Assets Order Effected by Eager Loading
# Assets Order Effected by Eager Loading

(Asked by: username_0 on 2016-03-15)

I am trying to eager load an asset field that contains 4 images.
When I originally set my entries the order was not affected as written below:
{% set products = craft.entries.section('products') %}

I then went and changed my set to leverage eager loading and upon doing so the order of the images was pretty much randomized throughout the template:
{% set products = craft.entries({
    section: 'products',
    with: [
        ['productImages', {
        withTransforms: ['small']
        }],
        'colorSelection']
}) %}

I then tried to add an order param next to withTransforms which did not have any effect either.
Is this a known issue?
UPDATE:
    
        
            
            {{gender}} - {{product.displayTitle}}
            {{product.price}}
        
    

Is how we are templating out each entry. Both provide a different order of assets.

**Tags:** entries, assets, order, eager-loading

> **Comments:**
> **username_1**: I'm not able to reproduce what you're seeing in my test case.  Can you update the question to show how you're displaying the images?  
> **username_0**: @BradBell updated it as requested.  
> **username_1**: Comes out in the proper fixed order with that template code on my end.     ¯\_(ツ)_/¯  
> **username_2**: @BradBell I'm seeing something similar in one of our builds. Can we send a support ticket? Or what's the best way to troubleshoot it?  
> **username_1**: @RobErskine sure, shoot a database backup and template we can reproduce with over to support@craftcms.com  
> **username_3**: This bug was fixed in [Craft 2.6.2778](https://craftcms.com/changelog#build2778).  

---

## 0 answers

