[PR #2407] [MERGED] fix: propagate is_archived from parent projects in ReadAll #8241

Closed
opened 2026-04-20 18:06:34 -05:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/go-vikunja/vikunja/pull/2407
Author: @tink-bot
Created: 3/17/2026
Status: ✅ Merged
Merged: 3/25/2026
Merged by: @kolaente

Base: main ← Head: fix/propagate-is-archived-readall-v2


📝 Commits (2)

  • 6d0c6f8 fix: propagate is_archived from parent to child projects in ReadAll CTE
  • c7d5e9c test: update expected results for archived project propagation

📊 Changes

7 files changed (+49 additions, -102 deletions)

View changed files

📝 pkg/models/label_permissions.go (+1 -1)
📝 pkg/models/label_test.go (+0 -10)
📝 pkg/models/project.go (+30 -17)
📝 pkg/models/project_test.go (+3 -3)
📝 pkg/models/task_collection_test.go (+2 -68)
📝 pkg/webtests/project_test.go (+11 -1)
📝 pkg/webtests/task_collection_test.go (+2 -2)

📄 Description

When fetching all projects via ReadAll, child projects of archived parents were returned with is_archived=false and appeared flat in the hierarchy (parent filtered out, children orphaned). The ReadOne endpoint correctly walked the parent chain to propagate the archived state, but ReadAll was missing this logic.

Adds propagateArchivedState() which walks the parent chain for each project and sets IsArchived=true if any ancestor is archived. When getArchived=false, these inherited-archived projects are also filtered out of the result set.

Fixes https://github.com/go-vikunja/vikunja/issues/2460


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/go-vikunja/vikunja/pull/2407 **Author:** [@tink-bot](https://github.com/tink-bot) **Created:** 3/17/2026 **Status:** ✅ Merged **Merged:** 3/25/2026 **Merged by:** [@kolaente](https://github.com/kolaente) **Base:** `main` ← **Head:** `fix/propagate-is-archived-readall-v2` --- ### 📝 Commits (2) - [`6d0c6f8`](https://github.com/go-vikunja/vikunja/commit/6d0c6f82b4d95976c4cccd965bff8919a09cc1e1) fix: propagate is_archived from parent to child projects in ReadAll CTE - [`c7d5e9c`](https://github.com/go-vikunja/vikunja/commit/c7d5e9c5ae8c909b6cd3521eb3c6b71e129b3678) test: update expected results for archived project propagation ### 📊 Changes **7 files changed** (+49 additions, -102 deletions) <details> <summary>View changed files</summary> 📝 `pkg/models/label_permissions.go` (+1 -1) 📝 `pkg/models/label_test.go` (+0 -10) 📝 `pkg/models/project.go` (+30 -17) 📝 `pkg/models/project_test.go` (+3 -3) 📝 `pkg/models/task_collection_test.go` (+2 -68) 📝 `pkg/webtests/project_test.go` (+11 -1) 📝 `pkg/webtests/task_collection_test.go` (+2 -2) </details> ### 📄 Description When fetching all projects via ReadAll, child projects of archived parents were returned with `is_archived=false` and appeared flat in the hierarchy (parent filtered out, children orphaned). The ReadOne endpoint correctly walked the parent chain to propagate the archived state, but ReadAll was missing this logic. Adds `propagateArchivedState()` which walks the parent chain for each project and sets `IsArchived=true` if any ancestor is archived. When `getArchived=false`, these inherited-archived projects are also filtered out of the result set. Fixes https://github.com/go-vikunja/vikunja/issues/2460 --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
GiteaMirror added the pull-request label 2026-04-20 18:06:34 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/vikunja#8241