<p>This is a change in behaviour from Craft 2 to Craft 3 and <a href="https://craftcms.com/docs/3.x/upgrade.html#cloning-element-queries" rel="nofollow noreferrer">here is the explanation</a>.</p>
<p>In short, you need to <code>clone</code> your query (<a href="https://craftcms.com/docs/3.x/dev/functions.html#clone" rel="nofollow noreferrer">docs</a>) - <a href="https://craftcms.stackexchange.com/a/37476/3630">see this post</a> for more info.</p>

CC BY-SA 4.0
2021-04-14T06:12:14.590Z
Thank you!! 
Document Services
CC BY-SA 4.0
2021-04-14T06:09:15.243Z
2021-04-14T06:09:15.243Z
Oli
<p>This question is related to: <a href="https://craftcms.stackexchange.com/questions/36690/supertable-returning-unexpected-results-w-template">SuperTable Returning Unexpected Results w/ Template</a>, which is still unresolved.</p>
<p>In essence, Im trying to return the results of a Supertable at two different points in my template.</p>
<pre><code>{% set featuredContributorsGrouped = entry.contributors
    .search('terms')
    .all()
    |group('contribution[0]')
%}
</code></pre>
<p>Appears in my template first, but when I try and reuse entry.contributors.all, it seems like it is already filtered by <code>terms</code>. This happens even if I recast <code>entry</code> as another temporary variable.</p>
<p>I was able to get around this by saving the full results as its own temporary variable <em>before</em> filtering it, but perhaps I'm not understanding how Craft queries modify entry information. I would assume it would be non destructive?</p>

<query><plugin-supertable>
Search Filters Results Unexpectedly
# Search Filters Results Unexpectedly

(Asked by: username_0 on 2021-04-13)

This question is related to: SuperTable Returning Unexpected Results w/ Template, which is still unresolved.
In essence, Im trying to return the results of a Supertable at two different points in my template.
{% set featuredContributorsGrouped = entry.contributors
    .search('terms')
    .all()
    |group('contribution[0]')
%}

Appears in my template first, but when I try and reuse entry.contributors.all, it seems like it is already filtered by terms. This happens even if I recast entry as another temporary variable.
I was able to get around this by saving the full results as its own temporary variable before filtering it, but perhaps I'm not understanding how Craft queries modify entry information. I would assume it would be non destructive?

**Tags:** query, plugin-supertable


---

## 1 answers

### Answer by username_1 on 2021-04-14. Score: 1

This is a change in behaviour from Craft 2 to Craft 3 and [here is the explanation](https://craftcms.com/docs/3.x/upgrade.html#cloning-element-queries).

In short, you need to `clone` your query ([docs](https://craftcms.com/docs/3.x/dev/functions.html#clone)) - [see this post](https://craftcms.stackexchange.com/a/37476/3630) for more info.

> **Comments:**
> **username_0**: Thank you!!   

---

