#[Publishable] on AbstractPage / AbstractPageData — page-level draft/live toggle
メンテナーはふだん 1 日以内に返信
まだ誰も着手していません。
評価
- 難易度
- 4/5
- 見積もり時間
- 3〜5日
- 初心者へのやさしさ
- 48/100
調査の方向性
AbstractPage と AbstractPageData から始め、既存のコンポーネントレベルの #[Publishable] 実装と voter ロジックを追跡します。AbstractRoutableVoter と RouteVoter も含めます。ルート解決と resource_manifest エンドポイントに加え、テンプレートおよび子パスとの相互作用を確認します。公開アクセスの拒否、管理者アクセス、PATCH による公開、既存ページ向けの後方互換性のあるマイグレーションについて Behat のカバレッジを追加します。
索引モデルが issue の本文から書いたものです。
説明
Problem
#[Publishable] (with publishedAt) exists for components: a component can be in draft state even inside a published page. There is no equivalent for pages themselves.
Currently, the only "draft" signal for a page is the absence of a Route. This works before publication, but once a page is live (route exists), there is no way to take it offline without deleting the route — losing URL history and any redirects pointed at it.
Desired behaviour
AbstractPage(base ofPageandAbstractPageData) gets apublishedAt: ?\DateTimeInterfacecolumn via#[Publishable](or a new#[PublishablePage]attribute if there are conflicts with the existing component-level implementation)- Unpublished pages (
publishedAt: null) are invisible to unauthenticated users via the existing voter infrastructure (AbstractRoutableVoter,RouteVoter) - Admins can still access and edit unpublished pages via the entity IRI (same as draft components today)
RouteVotergates public route resolution by the target page'spublishedAtstate- The
resource_manifestendpoint respects the same gate
Things to consider
#[Publishable]today lives on components; its voter logic (PublishableVoter?) would need to be checked / extended for page-level entitiesPage.isTemplatepages should probably always be accessible to admins regardless ofpublishedAt(template pages are never public-facing)- Draft page data entities with an existing Route — the route should resolve to 404/403 for public traffic, not 500
- Interaction with
cascadeChildPathsand the children endpoint: should unpublished children be hidden from the public children list? - Migration: existing pages have no
publishedAt— default tonull(draft) or tonow()(treat existing pages as already published)? Likelynow()for backwards compatibility
Acceptance criteria
-
AbstractPageand/orAbstractPageDatagain apublishedAtcolumn - Unauthenticated
GET /_/routes/{path}to a page withpublishedAt: nullreturns 403/404 - Admin
GET /_/resource_manifest/{uuid}for an unpublished page works forROLE_ADMIN - Behat scenarios cover: public access denied, admin access allowed, publish via PATCH
- Backwards-compatible migration (existing pages treated as published)
- 主要言語
- PHP
- スター
- 32
- フォーク
- 8
- 平均マージ
- 40分
- マージ済み PR(30日)
- 129
環境構築
このプロジェクトには開発コンテナ、Dockerfile、コントリビューションガイドがありません。まず README を読み、一般的な手順ははじめてのコントリビューションガイドを参照してください。
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
components-web-app/api-components-bundle のほかの issue
-
難易度 5/5 1週間以上 初心者へのやさしさ 30/100
components-web-app/api-components-bundle#333 · コメント 3 件 ·
メンテナーはふだん 1 日以内に返信
-
難易度 4/5 3〜5日 初心者へのやさしさ 48/100
components-web-app/api-components-bundle#325 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
難易度 3/5 1〜2日 初心者へのやさしさ 52/100
components-web-app/api-components-bundle#259 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
components-web-app/api-components-bundle の issue をすべて見る
似ている issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
Automattic/blocks-engine#2803 ·
メンテナーはふだん 1 日以内に返信
-
bug
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
hestiacp/hestiacp#5798 · コメント 2 件 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 62/100
woocommerce/woocommerce-google-analytics-integration#699 ·
メンテナーはふだん 1 日以内に返信
-
Sidebar highlights two items when plugin routes share a prefix (/plugin/foo and /plugin/foo-bar)オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
getgrav/grav-plugin-admin2#195 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 60/100
メンテナーはふだん 1 日以内に返信