#2844 closed defect (bug) (fixed)
Replies are not created with a unique post guid
Reported by: | netweb | Owned by: | netweb |
---|---|---|---|
Milestone: | 2.6 | Priority: | highest omg sweet tea |
Severity: | blocker | Version: | trunk |
Component: | Component - Replies | Keywords: | has-patch |
Cc: |
Description
Replies are not created with a unique post guid
Behaviour is common with both bbp_insert_reply()
and bbp_new_reply_handler()
Note: Only affects /trunk
replies do get a unique guid in 2.5 and 2.4
Failing test for replies, and passing test for topics attached:
1) BBP_Tests_Replies_Functions_Reply::test_bbp_insert_reply Failed asserting that two strings are equal. --- Expected +++ Actual @@ @@ -'http://example.org/?reply=5' +'http://example.org/?reply'
Attachments (2)
Change History (15)
This ticket was mentioned in Slack in #bbpress by tharsheblows. View the logs.
9 years ago
#3
@
9 years ago
ERR_INCOMPLETE_CHUNKED_ENCODING is caused by the case in bbp_get_reply_to_dropdown where reply_id = 0 and then get_the_title just can't handle it (used for 'show_none' in bbp_get_dropdown). This patch doesn't fix the failed phpunit tests though, only the new replies screen, and you might want to change the wording.
#4
follow-up:
↓ 6
@
9 years ago
I can't make BBP_Tests_Replies_Functions_Reply::test_bbp_insert_reply pass for 2.5.8.
My replies in 2.5.8 and 2.6 are getting unique guids when I test manually (? when I do it myself, not unit test, I mean). I noticed if you add in a post_title to the factory it works but that's the only difference I can find between it and topics. This is a "tell me what I'm doing wrong" request btw. :)
#5
@
9 years ago
Replying to tharsheblows:
My replies in 2.5.8 and 2.6 are getting unique guids when I test manually (? when I do it myself, not unit test, I mean).
I am not getting unique guids, manually testing this is via bbPress /trunk
r5924 below
Create a topic via the "front end":
<?php array( 'ID' => '690', 'post_author' => '1', 'post_date' => '2015-08-17 12:02:29', 'post_date_gmt' => '2015-08-17 02:02:29', 'post_content' => '2844 Topic', 'post_title' => '2844 Topic', 'post_excerpt' => '', 'post_status' => 'publish', 'comment_status' => 'closed', 'ping_status' => 'closed', 'post_password' => '', 'post_name' => '2844-topic', 'to_ping' => '', 'pinged' => '', 'post_modified' => '2015-08-17 12:02:29', 'post_modified_gmt' => '2015-08-17 02:02:29', 'post_content_filtered' => '', 'post_parent' => '523', 'guid' => 'http://src.wordpress-develop.dev/forums/topic/2844-topic/', 'menu_order' => '0', 'post_type' => 'topic', 'post_mime_type' => '', 'comment_count' => '0'),
Add a reply to the above topic via the "front end":
<?php array('ID' => '691', 'post_author' => '1', 'post_date' => '2015-08-17 12:05:00', 'post_date_gmt' => '2015-08-17 02:05:00', 'post_content' => '2844 Reply', 'post_title' => '', 'post_excerpt' => '', 'post_status' => 'publish', 'comment_status' => 'closed', 'ping_status' => 'closed', 'post_password' => '', 'post_name' => '691', 'to_ping' => '', 'pinged' => '', 'post_modified' => '2015-08-17 12:05:00', 'post_modified_gmt' => '2015-08-17 02:05:00', 'post_content_filtered' => '', 'post_parent' => '690', 'guid' => 'http://src.wordpress-develop.dev/forums/reply/', 'menu_order' => '1', 'post_type' => 'reply', 'post_mime_type' => '', 'comment_count' => '0') );
#6
in reply to:
↑ 4
@
9 years ago
Replying to tharsheblows:
I noticed if you add in a post_title to the factory it works but that's the only difference I can find between it and topics. This is a "tell me what I'm doing wrong" request btw. :)
This, right, and your correct this is bbp_get_reply_title_fallback()
and our adding the filter to the_title()
add_filter( 'the_title', 'bbp_get_reply_title_fallback', 2, 2 );
And, yes if we add post_title
to BBP_UnitTest_Factory_For_Reply
we get our GUID, we also get other "unexpected" results in the tests, I'll dig around and think about this part some more ¯\_(ツ)_/¯
#7
@
9 years ago
You're right, I'm wrong, don't change the unit tests.
It is working correctly for me on two installs (WP 4.2.4) and not on another (WP trunk), both are at bbPress r5924. I can see where it's failing but have no clue why. bbP is definitely calling wp_insert_post the exact same way but it's failing because in get_post_permalink (in link-template.php in wp-includes), it can't get the post_name.
All that's to say, hmm. It could be that I'm doing something wrong so if you have time, could you check it on WP 4.2.4? Or is that what you're using?
#8
@
9 years ago
In other news, if you merge back to wp:changeset:33262 in WP trunk it works again. <laughs hysterically>
This ticket was mentioned in Slack in #bbpress by boone. View the logs.
9 years ago
#10
@
9 years ago
- Keywords has-patch added; needs-patch removed
The reply guid is fixed in WP and there's a patch for the new reply page failure, so I'm marking as has-patch. I'm unsure of the wording of mine -- should it say "none"? Would it be better as "current topic"? Easy enough to change, I suppose!
#11
@
9 years ago
Ignore any bbp_get_reply_to_dropdown()
issues here in this ticket, they're now part of #2617 which I've reopened.
Also replies can not be created via the backend
Opening http://src.wordpress-develop.dev/wp-admin/post-new.php?post_type=reply will result in: