WordPress.org

Make WordPress Core

Opened 5 weeks ago

#44112 new defect (bug)

WP is changing page URL to avoid duplicate URL for non needed case

Reported by: tubys Owned by:
Milestone: Awaiting Review Priority: normal
Severity: normal Version: 4.9.5
Component: Networks and Sites Keywords:
Focuses: multisite Cc:

Description

WP has URL slug validator after page/post saved, when WP recognize potential of duplicate URL slug between the main site pages and each of existing multisites URL, WP will update the post_name (page slug URL) and adding suffix number to the page URL.

In the following scenario this validation should not be made:

  • Create New WP multi-site instance (sub-directory).
  • Create new site called ‘blog’ and publish it.
  • Move to root site.
  • Create new page without parent page with name ‘blog’ and publish it.
    • WP will change the page slug to ‘blog3’ (with number suffix) to avoid duplicate URL [OK]
  • Create new page with parent page ‘simple-page’ called ‘blog’ and publish it.
    • WP will change the site slug to ‘blog4’ [BUG]

In this case WP should leave the slug as is, because the result URL will be “simple-page/blog” and there is no URL conflict here.

Possible Solution: update “avoid_blog_page_permalink_collision” function [wp-admin/includes/ms.php:640] to do not modify the “post_name” if “post_parent” exists.

Change History (0)

Note: See TracTickets for help on using tickets.