Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Lack of checking for duplicate titles/URLs #8898

Open
sengi opened this issue Mar 14, 2024 · 0 comments
Open

Lack of checking for duplicate titles/URLs #8898

sengi opened this issue Mar 14, 2024 · 0 comments

Comments

@sengi
Copy link
Contributor

sengi commented Mar 14, 2024

I just got paged for WhitehallScheduledPublicationsOverdue where it turned out that a Whitehall scheduled publication had the same title and URL as an existing document on the live website.

It should not be possible to schedule publication of a document with a URL that's already taken by a page on the live website, but it seems we're not adequately validating this when the user creates the draft.

It probably shouldn't even be possible to create a draft with the same name/URL as another page.

At any rate, creating-a-document-with-a-name-clash is a basic error case that we need to be surfacing to the user at the point the mistake is made (i.e. as soon as possible after the user inputs the duplicate name).

Here's what happened in the particular case that I encountered:

Whitehall::UnpublishableInstanceError: URL: http://publishing-api/v2/content/57993145-2d19-46ae-8724-d111b617212d (Whitehall::UnpublishableInstanceError) Response body: {"error":{"code":422,"message":"Base path /government/news/appointment-of-8-court-examiners is already reserved by content-publisher","fields":{"base_path":["/government/news/appointment-of-8-court-examiners is already reserved by content-publisher"]}}}

Whitehall allowed this draft to not only be created with a clashing title but also scheduled for publication.

The document it clashed with is this one in content-publisher.

The two pages (the live one from content-pub and the draft one from whitehall) were identical.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant