I have just confirmed it in WordPress 3.6.1. The post content appears correctly in the blog, but the link goes to the page.
I’m not convinced that this is a bug per se. Posts and Pages are quite different objects, so giving the new object an url of -2 doesn’t really apply.
The bug is that the post is unreachable using its permalink. Whether adding -2 is the best way to fix the bug is perhaps a matter for debate. It is certainly one way to fix it, and it is consistent with the way WordPress behaves in other circumstances.
Rod – Can you test this on WP 3.5.2?
Also have you both tested with all plugins off?
I just verified that it does this in 3.6.1 with all plugins disabled.
This appears to be intentional per http://core.trac.wordpress.org/attachment/ticket/18962/wp-includes_post.diff
Since posts and pages (and custom post-types) are all separate groups, they dont’ check for collisions.
It may be, but it still makes for a bad user experience.
Since posts and pages (and custom post-types) are all separate groups, they dont’ check for collisions.
Ha-ha! Working as coded!
What really happened was that one developer thought it would be a good idea to separate posts and pages into separate namespaces, while another developer thought it would be a good idea to allow one of the standard permalink structures to make posts and pages share a namespace. The result is that a post’s permalink doesn’t always link to the post. I call that a bug. Yes, it was “intentional” but the intention wasn’t very well thought out.
What really happened was that one developer thought it would be a good idea to separate posts and pages into separate namespaces
No. All core development is community-driven. No one person gets to decide anything. Posts and Pages are completely separate objects. They are coded differently. Have different taxonomies/hierarchies. Different query objects. They are… different.
If you stick with the default permalink structure this kind of collision never happens. Ergo, it’s not a Page or Post coding issue. It only happens when people try to impose permalink structures that rely purely on object titles – instead of using numeric or date based permalink structures for Posts as most coders would still recommend & use themselves.