Fix handling of draft term pages

By just removing the term page and all of its page entries.

Fixes #12055
This commit is contained in:
Bjørn Erik Pedersen
2024-02-17 15:17:13 +01:00
parent 9cc65757a1
commit fc6aabe938
2 changed files with 27 additions and 2 deletions

View File

@@ -1415,8 +1415,10 @@ func (sa *sitePagesAssembler) applyAggregatesToTaxonomiesAndTerms() error {
if err := p.setMetaPost(cascade); err != nil {
return false, err
}
if err := sa.pageMap.treeTaxonomyEntries.WalkPrefix(
if !p.s.shouldBuild(p) {
sa.pageMap.treePages.Delete(s)
sa.pageMap.treeTaxonomyEntries.DeletePrefix(paths.AddTrailingSlash(s))
} else if err := sa.pageMap.treeTaxonomyEntries.WalkPrefix(
doctree.LockTypeRead,
paths.AddTrailingSlash(s),
func(ss string, wn *weightedContentNode) (bool, error) {