#[Publishable] on AbstractPage / AbstractPageData — page-level draft/live toggle
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 48/100
Research direction
Start with AbstractPage and AbstractPageData, then trace the existing component-level #[Publishable] implementation and voter logic, including AbstractRoutableVoter and RouteVoter. Check route resolution and the resource_manifest endpoint, plus interactions with templates and child paths. Add Behat coverage for public denial, admin access, publishing via PATCH, and a backwards-compatible migration for existing pages.
Written by the indexing model from the issue text.
Description
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)
- Dominant language
- PHP
- Stars
- 32
- Forks
- 8
- Avg merge
- 40m
- Merged PRs (30d)
- 129
Getting set up
This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from components-web-app/api-components-bundle
-
enhancement
Difficulty 4/5 3-5 days Newbie friendliness 35/100
components-web-app/api-components-bundle#452 ·
Maintainers usually reply within 1 day
-
Difficulty 5/5 Over a week Newbie friendliness 30/100
components-web-app/api-components-bundle#333 · 3 comments ·
Maintainers usually reply within 1 day
-
Difficulty 4/5 3-5 days Newbie friendliness 48/100
components-web-app/api-components-bundle#325 · 1 comment ·
Maintainers usually reply within 1 day
-
Difficulty 3/5 1-2 days Newbie friendliness 52/100
components-web-app/api-components-bundle#259 · 1 comment ·
Maintainers usually reply within 1 day
All issues in components-web-app/api-components-bundle
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 66/100
Automattic/blocks-engine#2866 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 62/100
community-scripts/ProxmoxVE#17944 · 1 comment ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 62/100
EasyCorp/EasyAdminBundle#7861 · 2 comments ·
Maintainers usually reply within 1 day
-
enhancement good first issue help wanted
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
-
backend gamification P0
Difficulty 2/5 1-3 hours Newbie friendliness 66/100
semanadeinformatica/website#461 ·