-
AuthorPosts
-
December 9, 2015 at 12:09 pm #699559
Hello,
When replying to forum replies (nested/threaded replies) everything works as it should in Internet Explorer, but in Chrome, instead of creating a nested reply, the user is taken to the general topic-reply form. The users think it will be a nested reply, and are of course frustrated when it ends up at the bottom of the list.
I have reverted to 2015 Theme and the reply button takes the user to the bottom of the page, but the form is updated to be a reply-to nested for (with the cancel button). So it appears to be an issue or conflict with Theme X.
In IE, no console errors are generated. Here is the error generated in Chrome when the REPLY button is clicked:
Uncaught TypeError: Failed to execute ‘insertBefore’ on ‘Node’: 2 arguments required, but only 1 present.
addReply.moveForm @ reply.js:18
onclick @ (index):406Wordpress version 4.3.1
X-Theme version: 4.1.0
bbPress version: 2.5.8I have also tried other versions of the bbPress plugin with no success.
December 9, 2015 at 4:21 pm #699912Hi there,
Would you mind providing us with login credentials so we can take a closer look? To do this, you can make a post with the following info:
– Link to your site
– WordPress Admin username / password
– FTP credentialsDon’t forget to select Set as private reply. This ensures your information is only visible to our staff.
December 9, 2015 at 4:56 pm #699965This reply has been marked as private.December 9, 2015 at 10:09 pm #700392Hi there,
I just tried out on my installation without X theme and it has same effect. It looks like an issue with bbpress plugin which works okay on IE.
I installed the older version downloaded here https://wordpress.org/plugins/bbpress/developers/
According to changelog,
Fix reply editing causing polluted hierarchy
And it fixes the issue on my end.
Thanks, please try that too.
December 10, 2015 at 10:06 am #701168Here is a link to a video showing the results. I have tried it with bbpress 2.5.4 and 2.5.8 with the same results.
https://recubed.tinytake.com/sf/NDEzNjc2XzIyNzQzNTY
First, with Theme X active, when clicking reply it takes you to the general reply button (no “cancel” option is available as there is with a reply to a reply)
You’ll see I switch to 2015 Theme and do the same process, and this time when it takes me to the form it is updated as a reply to a reply form, with the cancel button.
Currently on the site I provided credentials for I have reverted to 2.5.4 and it acting the same way, if you want to test again.
December 10, 2015 at 5:31 pm #701677Hi there,
In the video, all I could see is : in X when you hit reply it scrolls down to the form and without a cancel button. While on 2015 theme, it reloads the page to get to the form with cancel button. I just thought we’re discussing about the reply form appear under the post you’re replying to which works on IE.
And as you may observe from my video it loads the page which the same as yours, but it doesn’t have cancel button. Which is of course the same 2015.
I’d like to confirm, it’s just cancel button and scrolling/loading to form right? And upon investigating, I found out that the issue is originating from this file,
\wp-content\plugins\bbpress\includes\replies\template.php
From BBPress plugin itself, and here is the code that hides the cancel button.
function bbp_get_cancel_reply_to_link( $text = '' ) { // Bail if not hierarchical or editing a reply if ( ! bbp_thread_replies() || bbp_is_reply_edit() ) { return; } // Set default text if ( empty( $text ) ) { $text = __( 'Cancel', 'bbpress' ); } $reply_to = isset( $_GET['bbp_reply_to'] ) ? (int) $_GET['bbp_reply_to'] : 0; // Set visibility $style = !empty( $reply_to ) ? '' : ' style="display:none;"'; $link = remove_query_arg( array( 'bbp_reply_to', '_wpnonce' ) ) . '#post-' . $reply_to; $retval = '<a rel="nofollow" id="bbp-cancel-reply-to-link" href="' . esc_url( $link ) . '"' . $style . '>' . esc_html( $text ) . '</a>'; return apply_filters( 'bbp_get_cancel_reply_to_link', $retval, $link, $text ); }
Try changing this line of code :
$style = !empty( $reply_to ) ? '' : ' style="display:none;"';
to this,
$style = !empty( $reply_to ) ? '' : ' ';
And cancel button will appear.
Then the code that’s responsible for scrolling and loading is this,
function bbp_get_reply_to_link( $args = array() ) { // Parse arguments against default values $r = bbp_parse_args( $args, array( 'id' => 0, 'link_before' => '', 'link_after' => '', 'reply_text' => __( 'Reply', 'bbpress' ), 'depth' => 0, 'add_below' => 'post', 'respond_id' => 'new-reply-' . bbp_get_topic_id(), ), 'get_reply_to_link' ); // Get the reply to use it's ID and post_parent $reply = bbp_get_reply( bbp_get_reply_id( (int) $r['id'] ) ); // Bail if no reply or user cannot reply if ( empty( $reply ) || ! bbp_current_user_can_access_create_reply_form() ) return; // Build the URI and return value $uri = remove_query_arg( array( 'bbp_reply_to' ) ); $uri = add_query_arg( array( 'bbp_reply_to' => $reply->ID ) ); $uri = wp_nonce_url( $uri, 'respond_id_' . $reply->ID ); $uri = $uri . '#new-post'; // Only add onclick if replies are threaded if ( bbp_thread_replies() ) { // Array of classes to pass to moveForm $move_form = array( $r['add_below'] . '-' . $reply->ID, $reply->ID, $r['respond_id'], $reply->post_parent ); // Build the onclick $onclick = ' onclick="return addReply.moveForm(\'' . implode( "','", $move_form ) . '\');"'; // No onclick if replies are not threaded } else { $onclick = ''; } // Add $uri to the array, to be passed through the filter $r['uri'] = $uri; $retval = $r['link_before'] . '<a href="' . esc_url( $r['uri'] ) . '" class="bbp-reply-to-link"' . $onclick . '>' . esc_html( $r['reply_text'] ) . '</a>' . $r['link_after']; return apply_filters( 'bbp_get_reply_to_link', $retval, $r, $args ); }
Try changing this line of code :
// Build the onclick $onclick = ' onclick="return addReply.moveForm(\'' . implode( "','", $move_form ) . '\');"';
to this,
// Build the onclick $onclick = ' ';
And it should load it instead of scroll it.
Hope this helps.
December 11, 2015 at 3:00 pm #703255I appreciate the help, but it looks like I wasn’t clear about the issue. The reason that I was looking for the cancel button is that it’s an indicator that the form is being used to post a reply to someone else (a threaded reply)
From the code you posted, you’ll see that the cancel button is not present if it’s not a threaded reply
// Bail if not hierarchical or editing a reply if ( ! bbp_thread_replies() || bbp_is_reply_edit() ) { return; }
So, what is supposed to happen is that if a user clicks “Reply” to someone else’s comment, they are taken to a form which will nest/thread that comment under theirs – and this form will have a cancel button since it is a threaded reply.
Unfortunately, what is happening (in chrome) is that they are not taken to a “threaded reply” form, but just to the standard topic reply form at the bottom of the page. So, they think their reply will be threaded, but since it is the wrong form, their post just goes to the bottom of topic and is not nested.
Something must be conflicting in Theme X with chrome that prevents the form from updated to “threaded reply” from from the general form. I think it has something to do with the JS error I originally mentioned, that doesn’t appear in IE.
reply.js?ver=2.5.4-5380:18 Uncaught TypeError: Failed to execute 'insertBefore' on 'Node': 2 arguments required, but only 1 present. addReply.moveForm @ reply.js?ver=2.5.4-5380:18 onclick @ (index):406
December 11, 2015 at 8:16 pm #703562Hi there,
Yes, I understand what you mean 🙂
This is the same code, that allows me to find the origin. And it’s at bbpress template. This same issue is present when I switched to 2015, and tried it 3 times just to confirm, and even recorded the last test from my provided video.
reply.js?ver=2.5.4-5380:18 Uncaught TypeError: Failed to execute 'insertBefore' on 'Node': 2 arguments required, but only 1 present. addReply.moveForm @ reply.js?ver=2.5.4-5380:18 onclick @ (index):406
About the threading :
// Bail if not hierarchical or editing a reply if ( ! bbp_thread_replies() || bbp_is_reply_edit() ) { return; }
Yes, if it’s not part of hierarchy then it will exit the function. It will not execute the remaining code. But check this screenshot,
The cancel button is there, just hidden, because of this code :
// Set visibility $style = !empty( $reply_to ) ? '' : ' style="display:none;"';
Hence, the condition for hierarchy is met but javascript just fail to display it.
I’ll forward this to our developer for further investigation.
Thanks!
February 29, 2016 at 4:33 pm #817404Hi,
Did you get anywhere with this?
We have the same problem, the reply threading works in Safari but not on Chrome, Firefox or mobile browsers.We are on…
Wordpress v4.4.2
X-Theme v4.3.0
BBPress v2.5.8Thanks
February 29, 2016 at 11:58 pm #817836Hi,
Please update your theme and plugins to latest version.
The latest version numbers as of this time are: (http://theme.co/changelog/) Then you can compare them to what’s installed on your site.
X Theme 4.3.4
Cornerstone 1.1.3
BBPress v2.5.8If you find anything to be out of date, you can review our update guide.
Thanks
March 6, 2016 at 9:20 pm #826274Hi ThemeCo,
Do you have any update on this? I have the issue that @expectancylearning describes only it occurs in other browsers as well, not just Chrome.
I switch to the 2016 theme and everything works fine in terms of threaded replies. Switch back to X and the threads are displayed but you can’t reply to a particular comment only to topic as a whole.
It would be great to get a fix.
Many things
Mark
March 6, 2016 at 11:21 pm #826364Hi Mark,
Not yet, but it can be caused by any other contributing factors. Would you mind providing your site’s URL and a login in private reply?
I like to see if it’s just related to click and touch functionality.
Thanks!
March 7, 2016 at 4:54 am #826685This reply has been marked as private.March 7, 2016 at 1:27 pm #827415Hi There,
I could see a lot of script errors. check attached.
You could try testing for a plugin conflict. You can do this by deactivating all third party plugins, and seeing if the problem remains. If it’s fixed, you’ll know a plugin caused the problem, and you can narrow down which one by reactivating them one at a time.
-
AuthorPosts