<p>I found the issue about this problem.
I have in my code</p>
<pre><code>{% set selectedCategory = craft.app.request.getQueryParam('category') %}
</code></pre>
<p>but I change getQueryParam with queryParams('category');</p>
<pre><code>{% set selectedCategory = craft.app.request.queryParams('category') %}
</code></pre>
<p>and the problem was solved</p>

CC BY-SA 4.0
2021-07-12T19:44:07.597Z
2021-07-12T19:44:07.597Z
EdisonJS
<p>There's an issue when I filtering by categories but everything comes null, I was debugging code but all the entries has the same problem! But I don't know why does this happens? The entry comes well because I can show the text, title and so on, but I can´t get the categories. The filtering comes from params on the url.</p>
<p>For example</p>
<pre><code>array(1) { [0]=&gt; object(craft\elements\Category)#3085 (62) { [&quot;groupId&quot;]=&gt; string(1) &quot;6&quot; [&quot;newParentId&quot;]=&gt; NULL [&quot;deletedWithGroup&quot;]=&gt; bool(false) [&quot;_hasNewParent&quot;:&quot;craft\elements\Category&quot;:private]=&gt; NULL [&quot;revisionCreatorId&quot;:protected]=&gt; NULL [&quot;revisionNotes&quot;:protected]=&gt; NULL [&quot;_initialized&quot;:&quot;craft\base\Element&quot;:private]=&gt; bool(true) [&quot;_fieldsByHandle&quot;:&quot;craft\base\Element&quot;:private]=&gt; NULL [&quot;_fieldParamNamePrefix&quot;:&quot;craft\base\Element&quot;:private]=&gt; NULL [&quot;_normalizedFieldValues&quot;:&quot;craft\base\Element&quot;:private]=&gt; NULL [&quot;_allDirty&quot;:&quot;craft\base\Element&quot;:private]=&gt; bool(false) [&quot;_dirtyAttributes&quot;:&quot;craft\base\Element&quot;:private]=&gt; array(0) { } [&quot;_savedTitle&quot;:&quot;craft\base\Element&quot;:private]=&gt; string(4) &quot;News&quot; [&quot;_dirtyFields&quot;:&quot;craft\base\Element&quot;:private]=&gt; NULL [&quot;_nextElement&quot;:&quot;craft\base\Element&quot;:private]=&gt; bool(false) [&quot;_prevElement&quot;:&quot;craft\base\Element&quot;:private]=&gt; bool(false) [&quot;_parent&quot;:&quot;craft\base\Element&quot;:private]=&gt; NULL [&quot;_prevSibling&quot;:&quot;craft\base\Element&quot;:private]=&gt; NULL [&quot;_nextSibling&quot;:&quot;craft\base\Element&quot;:private]=&gt; NULL [&quot;_eagerLoadedElements&quot;:&quot;craft\base\Element&quot;:private]=&gt; NULL [&quot;_eagerLoadedElementCounts&quot;:&quot;craft\base\Element&quot;:private]=&gt; NULL [&quot;_currentRevision&quot;:&quot;craft\base\Element&quot;:private]=&gt; NULL [&quot;_enabledForSite&quot;:&quot;craft\base\Element&quot;:private]=&gt; bool(true) [&quot;_uiLabel&quot;:&quot;craft\base\Element&quot;:private]=&gt; NULL [&quot;_errors&quot;:&quot;yii\base\Model&quot;:private]=&gt; NULL [&quot;_validators&quot;:&quot;yii\base\Model&quot;:private]=&gt; NULL [&quot;_scenario&quot;:&quot;yii\base\Model&quot;:private]=&gt; string(7) &quot;default&quot; [&quot;_events&quot;:&quot;yii\base\Component&quot;:private]=&gt; array(0) { } [&quot;_eventWildcards&quot;:&quot;yii\base\Component&quot;:private]=&gt; array(0) { } [&quot;_behaviors&quot;:&quot;yii\base\Component&quot;:private]=&gt; array(1) { [&quot;customFields&quot;]=&gt; object(craft\behaviors\CustomFieldBehavior)#3086 (140) { [&quot;hasMethods&quot;]=&gt; bool(false) [&quot;heroLogo&quot;]=&gt; NULL [&quot;copy&quot;]=&gt; NULL [&quot;cta&quot;]=&gt; NULL [&quot;svg&quot;]=&gt; NULL [&quot;heroIcon&quot;]=&gt; NULL [&quot;heading&quot;]=&gt; NULL [&quot;icon&quot;]=&gt; NULL [&quot;heroBg&quot;]=&gt; NULL [&quot;backgroundImage&quot;]=&gt; NULL [&quot;blocks&quot;]=&gt; NULL [&quot;social&quot;]=&gt; NULL [&quot;network&quot;]=&gt; NULL [&quot;externalLink&quot;]=&gt; NULL [&quot;formId&quot;]=&gt; NULL [&quot;image&quot;]=&gt; NULL [&quot;video&quot;]=&gt; NULL [&quot;heroProductDetail&quot;]=&gt; NULL [&quot;heroUseCase&quot;]=&gt; NULL [&quot;bullets&quot;]=&gt; NULL [&quot;tabs&quot;]=&gt; NULL [&quot;testimonials&quot;]=&gt; NULL [&quot;quote&quot;]=&gt; NULL [&quot;authorName&quot;]=&gt; NULL [&quot;circles&quot;]=&gt; NULL [&quot;cards&quot;]=&gt; NULL [&quot;stars&quot;]=&gt; NULL [&quot;logo&quot;]=&gt; NULL [&quot;accreditations&quot;]=&gt; NULL [&quot;badges&quot;]=&gt; NULL [&quot;blogs&quot;]=&gt; NULL [&quot;column&quot;]=&gt; NULL [&quot;hubspotFormId&quot;]=&gt; NULL [&quot;company&quot;]=&gt; NULL [&quot;authorCompany&quot;]=&gt; NULL [&quot;optimizedImage&quot;]=&gt; NULL [&quot;seo&quot;]=&gt; NULL [&quot;copyBg&quot;]=&gt; NULL [&quot;newsAndBlogs&quot;]=&gt; NULL [&quot;featuredPressRelease&quot;]=&gt; NULL [&quot;featuredEntry&quot;]=&gt; NULL [&quot;featured&quot;]=&gt; NULL [&quot;categoryBg&quot;]=&gt; NULL [&quot;heroSimple&quot;]=&gt; NULL [&quot;resultsLayout&quot;]=&gt; NULL [&quot;assetType&quot;]=&gt; NULL [&quot;resourceCategories&quot;]=&gt; NULL [&quot;product&quot;]=&gt; NULL [&quot;newsUpdatesSubscription&quot;]=&gt; NULL [&quot;privacyPolicy&quot;]=&gt; NULL [&quot;blogCategories&quot;]=&gt; NULL [&quot;threeColumn&quot;]=&gt; NULL [&quot;fourColumn&quot;]=&gt; NULL [&quot;tableMaker&quot;]=&gt; NULL [&quot;resources&quot;]=&gt; NULL [&quot;resourcesCta&quot;]=&gt; NULL [&quot;featuredImage&quot;]=&gt; NULL [&quot;newsPressCategories&quot;]=&gt; NULL
</code></pre>

CC BY-SA 4.0
2021-07-11T13:35:39.090Z
Could you please post your section/field setup and twig code?
Simon Kuran
<categories><params><null>
Everything comes null when I try to filter entries by category - Craftcms 3
# Everything comes null when I try to filter entries by category - Craftcms 3

(Asked by: username_0 on 2021-07-09)

There's an issue when I filtering by categories but everything comes null, I was debugging code but all the entries has the same problem! But I don't know why does this happens? The entry comes well because I can show the text, title and so on, but I can´t get the categories. The filtering comes from params on the url.
For example
array(1) { [0]=> object(craft\elements\Category)#3085 (62) { ["groupId"]=> string(1) "6" ["newParentId"]=> NULL ["deletedWithGroup"]=> bool(false) ["_hasNewParent":"craft\elements\Category":private]=> NULL ["revisionCreatorId":protected]=> NULL ["revisionNotes":protected]=> NULL ["_initialized":"craft\base\Element":private]=> bool(true) ["_fieldsByHandle":"craft\base\Element":private]=> NULL ["_fieldParamNamePrefix":"craft\base\Element":private]=> NULL ["_normalizedFieldValues":"craft\base\Element":private]=> NULL ["_allDirty":"craft\base\Element":private]=> bool(false) ["_dirtyAttributes":"craft\base\Element":private]=> array(0) { } ["_savedTitle":"craft\base\Element":private]=> string(4) "News" ["_dirtyFields":"craft\base\Element":private]=> NULL ["_nextElement":"craft\base\Element":private]=> bool(false) ["_prevElement":"craft\base\Element":private]=> bool(false) ["_parent":"craft\base\Element":private]=> NULL ["_prevSibling":"craft\base\Element":private]=> NULL ["_nextSibling":"craft\base\Element":private]=> NULL ["_eagerLoadedElements":"craft\base\Element":private]=> NULL ["_eagerLoadedElementCounts":"craft\base\Element":private]=> NULL ["_currentRevision":"craft\base\Element":private]=> NULL ["_enabledForSite":"craft\base\Element":private]=> bool(true) ["_uiLabel":"craft\base\Element":private]=> NULL ["_errors":"yii\base\Model":private]=> NULL ["_validators":"yii\base\Model":private]=> NULL ["_scenario":"yii\base\Model":private]=> string(7) "default" ["_events":"yii\base\Component":private]=> array(0) { } ["_eventWildcards":"yii\base\Component":private]=> array(0) { } ["_behaviors":"yii\base\Component":private]=> array(1) { ["customFields"]=> object(craft\behaviors\CustomFieldBehavior)#3086 (140) { ["hasMethods"]=> bool(false) ["heroLogo"]=> NULL ["copy"]=> NULL ["cta"]=> NULL ["svg"]=> NULL ["heroIcon"]=> NULL ["heading"]=> NULL ["icon"]=> NULL ["heroBg"]=> NULL ["backgroundImage"]=> NULL ["blocks"]=> NULL ["social"]=> NULL ["network"]=> NULL ["externalLink"]=> NULL ["formId"]=> NULL ["image"]=> NULL ["video"]=> NULL ["heroProductDetail"]=> NULL ["heroUseCase"]=> NULL ["bullets"]=> NULL ["tabs"]=> NULL ["testimonials"]=> NULL ["quote"]=> NULL ["authorName"]=> NULL ["circles"]=> NULL ["cards"]=> NULL ["stars"]=> NULL ["logo"]=> NULL ["accreditations"]=> NULL ["badges"]=> NULL ["blogs"]=> NULL ["column"]=> NULL ["hubspotFormId"]=> NULL ["company"]=> NULL ["authorCompany"]=> NULL ["optimizedImage"]=> NULL ["seo"]=> NULL ["copyBg"]=> NULL ["newsAndBlogs"]=> NULL ["featuredPressRelease"]=> NULL ["featuredEntry"]=> NULL ["featured"]=> NULL ["categoryBg"]=> NULL ["heroSimple"]=> NULL ["resultsLayout"]=> NULL ["assetType"]=> NULL ["resourceCategories"]=> NULL ["product"]=> NULL ["newsUpdatesSubscription"]=> NULL ["privacyPolicy"]=> NULL ["blogCategories"]=> NULL ["threeColumn"]=> NULL ["fourColumn"]=> NULL ["tableMaker"]=> NULL ["resources"]=> NULL ["resourcesCta"]=> NULL ["featuredImage"]=> NULL ["newsPressCategories"]=> NULL

**Tags:** categories, params, null
> **Comments:**
> **username_1**: Could you please post your section/field setup and twig code?  

---

## 1 answers

### Answer by username_0 on 2021-07-12. Score: 1 | Accepted answer

I found the issue about this problem.
I have in my code
{% set selectedCategory = craft.app.request.getQueryParam('category') %}

but I change getQueryParam with queryParams('category');
{% set selectedCategory = craft.app.request.queryParams('category') %}

and the problem was solved


---

