statamic / cms

The core Laravel CMS Composer package
https://statamic.com
Other
4.05k stars 530 forks source link

Stache not invalidated when an entry's taxonomy changes #3091

Closed wesort closed 3 years ago

wesort commented 3 years ago

Bug Description

Two (related?) ways:

  1. There were work entries with a type (Taxonomy, example term "Drawings") but edits are made and there are no longer any entries with that type. eg: Drawings should disappear from 2nd nav but doesn't.
  2. Sometimes after edits to work entries the sequence of the terms doesn't obey the order.

Both bugs fixed by clearing Stache.

How to Reproduce

A taxonomy called type is used for a second level navigation for a collection called work.

type has a text field named order to allow admins to sequence the terms on the frontend. Admins input a number.

The relevant section of the 2nd nav:

{{ taxonomy:type min_count="1" sort="order" }}
  <li>
    <a href="/work{{ url }}">{{ title }}</a>
  </li>
{{ /taxonomy:type }}

Entries in the work collection have a terms fieldtype (max_items: 1).

Environment

Statamic 3.0.37 Pro Laravel 7.29.3 PHP 7.2.24-0ubuntu0.18.04.7 Server Forge Provisioned DO droplet

Install method Clone of previous site which originated from Cool Writings starter kit

j3ll3yfi5h commented 3 years ago

I'm having the same problem. Adding a term clears stache, removing a term doesn't