WordPress.org

Make WordPress Core

Opened 3 weeks ago

Last modified 3 weeks ago

#51147 reviewing defect (bug)

avoid_blog_page_permalink_collision shouldn't change the post_name when the page has a parent.

Reported by: stormrockwell Owned by: SergeyBiryukov
Milestone: 5.6 Priority: normal
Severity: normal Version: trunk
Component: Posts, Post Types Keywords: has-patch needs-unit-tests
Focuses: administration, multisite Cc:

Description

How to reproduce:

Create multisite install (subdirectory)
Add subsite "bar"
On the main site, create a page for "foo" and a page for "bar" with the parent "foo"

When trying to publish that page you will get /foo/bar{rand1-10}.

Attachments (4)

51147.diff (455 bytes) - added by stormrockwell 3 weeks ago.
51147.2.diff (2.8 KB) - added by stormrockwell 3 weeks ago.
Add unit test
51147.3.diff (2.8 KB) - added by stormrockwell 3 weeks ago.
Unit tests & fix typo in comment.
51147.4.diff (2.8 KB) - added by stormrockwell 3 weeks ago.
Change the class name

Download all attachments as: .zip

Change History (6)

@stormrockwell
3 weeks ago

#1 @SergeyBiryukov
3 weeks ago

  • Component changed from Administration to Posts, Post Types
  • Focuses administration multisite added
  • Keywords has-patch needs-unit-tests added
  • Milestone changed from Awaiting Review to 5.6
  • Owner set to SergeyBiryukov
  • Status changed from new to reviewing

Hi there, welcome back to WordPress Trac!

Thanks for the ticket and the patch, this makes sense at a glance.

A unit test to confirm the fix would also be great.

@stormrockwell
3 weeks ago

Add unit test

#2 @stormrockwell
3 weeks ago

This was my first go at unit tests. Any feedback is much appreciated.

@stormrockwell
3 weeks ago

Unit tests & fix typo in comment.

@stormrockwell
3 weeks ago

Change the class name

Note: See TracTickets for help on using tickets.