Support » Plugin: Relevanssi - A Better Search » WP 4.0 / Relevanssi / bbPress

Viewing 15 replies - 1 through 15 (of 15 total)
  • tylertervooren

    (@tylertervooren)

    Same problem.

    SlothLoveChunk

    (@slothlovechunk)

    Same here.

    Plugin Author Mikko Saari

    (@msaari)

    Yes, the problem seems to be WP 4.0, because I tried reverting back to 3.3.5 and that didn’t help. I thought so, as nothing should’ve changed in Relevanssi to cause the problem.

    Anyway, I did figure out a fix. In relevanssi/lib/common.php, find relevanssi_prevent_default_request() and this line:

    if (is_array($query->query_vars['post_type']) && in_array('forum', $query->query_vars['post_type'])) {

    Change it to:

    if ($query->query_vars['post_type'] == 'topic') {

    That should fix it. If somebody can confirm that it indeed does so, I’ll get 3.3.7 out soon.

    Hi Mikko,

    Thanks for getting onto this so quickly.

    The tweak above half-fixes the problem: I can now see the topics listed in the forum, but when I visit any of those topics I just get a reply box (and can’t see the first post or any already-submitted replies to it.)

    Best,
    Kona

    meccub

    (@meccub)

    Hi Mikko,

    Same experience as kona. Applying your fix lists the topics in the forum, but going into the topic still just shows the reply box, not the replies.

    Thanks for looking into this.

    Plugin Author Mikko Saari

    (@msaari)

    Please try this version:

    $bbpress = false;
    if ($query->query_vars['post_type'] == 'topic') $bbpress = true;
    if (is_array($query->query_vars['post_type']) && in_array('topic', $query->query_vars['post_type'])) $bbpress = true;
    if ($bbpress) {
    	// this is a BBPress search; do not meddle
    	return $request;
    }

    Hi Mikko,

    Yes, that second fix seems to have done it – I can now see the original post and all replies in a topic. Thanks!

    All best,
    Kona

    Daniel

    (@dhoffmann)

    Yes, works fine now again. Thanks a lot (www.celtic-rock.de).

    meccub

    (@meccub)

    Works. Thanks for the fix.

    Plugin Author Mikko Saari

    (@msaari)

    Great, I just uploaded 3.3.7 which includes this fix.

    SlothLoveChunk

    (@slothlovechunk)

    On my end the fix in 3.3.7 got topics showing again, but replies were still missing. Adding an additional check for “post_type == ‘reply'” in common.php gets them showing:

    if ($query->query_vars['post_type'] == 'topic' || $query->query_vars['post_type'] == 'reply') $bbpress = true;
    		if (is_array($query->query_vars['post_type']) && in_array('topic', $query->query_vars['post_type']) && in_array('reply', $query->query_vars['post_type'])) $bbpress = true;

    Disclaimer, I am no expert here, so there may be a better solution.

    SlothLoveChunk

    (@slothlovechunk)

    Sorry, my logic in the second line above was incorrect. I think the following is correct (again, there may be a better way):

    if ($query->query_vars['post_type'] == 'topic' || $query->query_vars['post_type'] == 'reply') $bbpress = true;
    		if (is_array($query->query_vars['post_type']) && (in_array('topic', $query->query_vars['post_type']) || in_array('reply', $query->query_vars['post_type']))) $bbpress = true;
    Plugin Author Mikko Saari

    (@msaari)

    Thanks, when I tested the original code on my site it showed everything there was to see. I added your fix now.

    lukeoatham

    (@lukeoatham)

    Getting the same problem on premium – will there me a fix for this?

    Plugin Author Mikko Saari

    (@msaari)

    Yes, the fix will be included in the next version of Premium. Here’s the complete fix if you want it fixed now. In lib/common.php, replace this:

    if (is_array($query->query_vars['post_type']) && in_array('forum', $query->query_vars['post_type'])) {
    			// this is a BBPress search; do not meddle
    			return $request;
    		}

    with this:

    $bbpress = false;
    		if ($query->query_vars['post_type'] == 'topic' || $query->query_vars['post_type'] == 'reply') $bbpress = true;
    		if (is_array($query->query_vars['post_type'])) {
    		 	if (in_array('topic', $query->query_vars['post_type'])) $bbpress = true;
    		 	if (in_array('reply', $query->query_vars['post_type'])) $bbpress = true;
    		}
    		if ($bbpress) {
    			// this is a BBPress search; do not meddle
    			return $request;
    		}
Viewing 15 replies - 1 through 15 (of 15 total)
  • The topic ‘WP 4.0 / Relevanssi / bbPress’ is closed to new replies.