statamic / v2-hub

Statamic 2 - Feature Requests and Bug Reports
https://statamic.com
95 stars 5 forks source link

Fieldset and taxonomy #2409

Closed freshface closed 5 years ago

freshface commented 5 years ago

Describe the bug When creating a fieldset with a taxonomy field the display name should be the same as the used taxonomy

To Reproduce Steps to reproduce the behavior:

  1. Create a fieldset with a taxonomy field
  2. Use a different field name as the used taxonomy
  3. Create a collection base on the fieldset
  4. Add a taxonomy on the collection entry
  5. Now you will see that in the yam file it is store like this:
category:
  - categories/test-cat
  - categories/sculpture

I used category as diplay name but my taxonomie is named categories

Expected behavior When using a different display name it should not interfere with storing it.

thinkingcap commented 5 years ago

I had the issue where I named a taxonomy in a fieldset 'offer_type' but the taxonomy name was 'offer-type' with a dash. Everything seemed to work on the collection side with editing and choosing your taxonomy but when looping through taxonomy items you get no association back to the collection.

jasonvarga commented 5 years ago

That’s how it works. If it’s not taxonomizing the content (where it uses the same name) it saves the full taxonomy/term string. https://docs.statamic.com/taxonomies#taxonomizing

It does that because the field could potentially have terms from multiple taxonomies.