statamic / v2-hub

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

Editing Taxonomy in Control Panel Removes Template Definition in tags.yaml #2480

Open cnc137 opened 4 years ago

cnc137 commented 4 years ago

Describe the bug Editing a taxonomy in the Statamic Control Panel removes the "template" definition from the "site/content/taxonomies/tags.yaml" file.

To Reproduce The default "site/content/taxonomies/tags.yaml" file in the Redwood theme looks like this:

title: Tags
template: blog/taxonomy

If I edit the settings under the Control Panel under "Configure/Content/Taxonomies/Tags" and save them it switches the "site/content/taxonomies/tags.yaml" file to look like the following and removes the "template: blog/taxonomy" entry in the file.

title: Tags
fieldset: null

This in turn causes the tag page located at http://statamic.test/blog/tags/coffee and others to no longer use the template file located at "site/themes/templates/blog/taxonomy.html" without manually editing the "tags.yaml" file to add "template: blog/taxonomy" back in.

To Reproduce Steps to reproduce the behavior:

  1. Go to Statamic Dashboard
  2. Click on "Content > Taxonomies > Tags"
  3. Edit "Title" field and click "Save" button or just click "Save" button without editing anything.
  4. Look at the "site/content/taxonomies/tags.yaml" file and you will see that the "template" information has been removed.

Expected behavior When editing a taxonomy in the Control Panel the "template" definition should not be removed.

Environment details (please complete the following information):