WordPress.org

Make WordPress Core

Opened 15 months ago

Last modified 15 months ago

#37336 new defect (bug)

Pre-existing page with slug /embed/ does not work as described

Reported by: smerriman Owned by:
Milestone: Awaiting Review Priority: normal
Severity: normal Version: 4.5
Component: Embeds Keywords: needs-patch needs-unit-tests
Focuses: Cc:

Description (last modified by swissspidy)

In #34971, embeds were added to static frontpages, and there was a discussion of how this would affect an existing page with a slug of /embed/.

The solution was:

  • an existing page with slug /embed/ will work as is and disable the pretty embed URL
  • new pages can't be created with a slug of /embed/.

However, this did not work properly. On a site of mine, there is a page with URL /embed/ that was working fine prior to this upgrade. Now:

  • if you visit /embed/, you are redirected to the homepage.
  • if you attempt to edit the page, the slug previews as /embed-2/, meaning editing the page content and saving has the unwanted side effect of forcing the URL to change and all links to the page to break without warning.

Suggested changes:

  • fix whatever is incorrectly redirecting the URL
  • allow a slug of /embed/ to continue to save as-is if it already exists.

Change History (1)

#1 @swissspidy
15 months ago

  • Description modified (diff)
  • Keywords needs-patch needs-unit-tests added
  • Version changed from trunk to 4.5

Thanks for your report! I could reproduce this by manually changing a post's slug in the database (simulating an already existing post with that slug).

This means a visitor cannot access a post with that slug, which is of course a no-go.

Note: See TracTickets for help on using tickets.