# Custom Field funktioniert nicht mehr

**URL:** <https://forum.shopware.com/t/custom-field-funktioniert-nicht-mehr/97281>\
**Category:** Shopware 6 (German)\
**Created:** [25. November 2022 um 08:03 UTC](https://forum.shopware.com/t/custom-field-funktioniert-nicht-mehr/97281 "2022-11-25T08:03:48Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![ergobasis](https://avatars.discourse-cdn.com/v4/letter/e/439d5e/32.png) [@ergobasis](https://forum.shopware.com/u/ergobasis)\
**Post date:** [25. November 2022 um 08:03 UTC](https://forum.shopware.com/t/custom-field-funktioniert-nicht-mehr/97281/1 "2022-11-25T08:03:48Z")

</div>

Hey Leute,  
Ich habe heute gemerkt, dass Shopware meinen Feed nicht mehr erstellen kann und ich bekomme die Fehlermeldung, dass die Zuweisung meines Freitextfelds nicht passt. Bisher ging es immer mit {{ product.translated.customFields.product\_customfields\_googlecategory }}.  
Fehlermeldung:

> Failed rendering string template using Twig: Failed rendering string template using Twig: Key „product\_customfields\_googlecategory“ does not exist as the array is empty

Hat noch jemand das Problem? Ich bin komplett überfragt, was ich da machen soll.

---

<div class="post-metadata">

**Author:** ![Max\_Shop](https://avatars.discourse-cdn.com/v4/letter/m/58f4c7/32.png) [@Max\_Shop](https://forum.shopware.com/u/Max_Shop)\
**Post date:** [25. November 2022 um 14:16 UTC](https://forum.shopware.com/t/custom-field-funktioniert-nicht-mehr/97281/2 "2022-11-25T14:16:58Z")

</div>

Wird auf Customs Fields nicht als Objekt per . zugegriffen? Array scheint mir hier fehl am Platz zu sein.

---

<div class="post-metadata">

**Author:** ![R4M](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.shopware.com/r4m/32/9983_2.png) [@R4M](https://forum.shopware.com/u/R4M)\
**Post date:** [25. November 2022 um 15:13 UTC](https://forum.shopware.com/t/custom-field-funktioniert-nicht-mehr/97281/3 "2022-11-25T15:13:26Z")

</div>

> [@ergobasis](#):
>
> product\_customfields\_googlecategory

Ist denn das Zusatzfeld so korrekt noch vorhanden und eingestellt? Bin vor kurzem auf die Fresse geflogen, weil ein Leerzeichen störte. Ist nur so eine Idee!

Wobei, ist das bei Product nicht so?

```auto
{{ page.product.customFields.product_customfields_googlecategory }}

```

---

<div class="post-metadata">

**Author:** ![abdullah](https://avatars.discourse-cdn.com/v4/letter/a/aeb1de/32.png) [@abdullah](https://forum.shopware.com/u/abdullah)\
**Post date:** [25. November 2022 um 16:35 UTC](https://forum.shopware.com/t/custom-field-funktioniert-nicht-mehr/97281/4 "2022-11-25T16:35:32Z")

</div>

Laut der Fehlermeldung sind die CustomFields leer…

Eventuell wurde ein neues Produkt erstellt und dem das googlecategory Customfield nicht zugewiesen? Also ein Wert wurde nicht zugeordnet.

---

<div class="post-metadata">

**Author:** ![ergobasis](https://avatars.discourse-cdn.com/v4/letter/e/439d5e/32.png) [@ergobasis](https://forum.shopware.com/u/ergobasis)\
**Post date:** [28. November 2022 um 08:05 UTC](https://forum.shopware.com/t/custom-field-funktioniert-nicht-mehr/97281/5 "2022-11-28T08:05:51Z")

</div>

Ich hab das Rätsel gelöst.  
Im Feed muss man ein Freitextfeld wohl erst auf „definded“ abfragen:

```auto
<g:google_product_category>
      {% if product.translated.customFields.product_customfields_googlecategory is defined %}
             {{ product.translated.customFields.product_customfields_googlecategory }}
      {% endif %}
</g:google_product_category>

```

Dann meckert der Compiler auch nicht mehr und das ganze funktioniert.

Wie [abdullah](https://forum.shopware.com/u/abdullah) schon erwähnt hatte, kann es sein, dass ein Produkt angelegt wurde, bei dem das Feld nicht gesetzt wurde. Warum das ganze dann nicht einfach leer bleibt, weiß ich auch nicht. Wäre auf jeden einfacher gewesen.
