when you last reported it, I said
‘ok, I can only suggest that you revert to the standard tests
Themes
As a test switch to a default theme such as twentyfifteen, and see if this fixes.
Plugins
If that doesnβt work, also deactivate all plugins apart from bbpress and see if this fixes. if it does, re-enable one at a time to see which is causing the error.
Then come back@
you did not respond to that, so can’t really help further if you don’t do the tests π
Hi @robin-w
The offending plugin is “Theme My Login”.
ok, so you’ll contact them next I guess π
At least I was able to do the split and then move the topic by temporarily deactivating the plugin.
Side note @robin-w – I raised a issue on your forum about a bbp style pack critical error I received today.
bug found and fixed in 4.4.5
I had this reply @robin-w:
I’d suggest filing a bug report with bbPress.
The issue is that TML registers ‘action’ as a public query variable with WP. WP has a check in WP::parse_request(), which ensures that all GET and POST values of public query variables match. If they don’t, it dies with the error message you are seeing.
For whatever reason, bbPress uses a different action key depending on GET/POST context. In this specific instance, the GET value of ‘action’ is ‘split’. However, the POST value (set via hidden field in the form) is ‘bbp-split-topic’. This difference is causing the condition described above.
In code:
$_GET['action'] = 'split';
$_POST['action'] = 'bbp-split-topic';
if ( isset( $_GET[ 'action' ] ) && isset( $_POST[ 'action' ] ) && $_GET[ 'action' ] !== $_POST[ 'action ] ) {
wp_die( __( 'A variable mismatch has been detected.' ), __( 'Sorry, you are not allowed to view this item.' ), 400 ); }
that’s a great response, let me look at it later
can you try this in your child theme function file or snippets
function rew_get_topic_split_link( $retval, $r, $args ) {
// Parse arguments against default values
$r = bbp_parse_args( $args, array(
'id' => 0,
'link_before' => '',
'link_after' => '',
'split_text' => esc_html__( 'Split', 'bbpress' ),
'split_title' => esc_attr__( 'Split the topic from this reply', 'bbpress' )
), 'get_topic_split_link' );
// Get IDs
$reply_id = bbp_get_reply_id( $r['id'] );
$topic_id = bbp_get_reply_topic_id( $reply_id );
// Bail if no reply/topic ID, or user cannot moderate
if ( empty( $reply_id ) || empty( $topic_id ) || ! current_user_can( 'moderate', $topic_id ) ) {
return;
}
$uri = add_query_arg( array(
'action' => 'bbp-split-topic',
'reply_id' => $reply_id
), bbp_get_topic_edit_url( $topic_id ) );
$retval = $r['link_before'] . '<a href="' . esc_url( $uri ) . '" title="' . $r['split_title'] . '" class="bbp-topic-split-link">' . $r['split_text'] . '</a>' . $r['link_after'];
// Filter & return
return apply_filters( 'rew_get_topic_split_link', $retval, $r, $args );
}
add_filter ('bbp_get_topic_split_link', 'rew_get_topic_split_link' , 10 , 3) ;
function rew_is_topic_split() {
// Assume false
$retval = false;
// Check topic edit and GET params
if ( bbp_is_topic_edit() && ! empty( $_GET['action'] ) && ( 'bbp-split-topic' === $_GET['action'] ) ) {
$retval = true;
}
// Filter & return
return (bool) apply_filters( 'rew_is_topic_split', $retval );
}
add_filter ('bbp_is_topic_split' , 'rew_is_topic_split' ) ;
Took a while to work out where the chnages were needed π
I’ve raised a ticket – and I’ll add it to style pack bugs shortly – thanks for testing that it worked for you also !!
I appreciate you taking the time with that.
Hi @robin-w
RThanks for your latest bbp updates. I have activated your new bug fix check box and removed my code from functions.php and I can still split topics. Woo hoo!
great – glad it is all working !!