• Resolved fwmone

    (@fwmone)


    Hi,

    I use the great CRP plugin in two ways: As an automatic addition to most of the pages and as a manual block I insert at a specific location. After updating to 3.0.6, the latter does not show anything. After reverting to 3.0.5, it works again. I’ve already tried to clear all caches.

    Please see an example of how I integrated the block at https://www.milwaukee-vtwin.de/harley-davidson-2001-fxd-dyna-super-glide and search for “Auch interessant…” In the 3.0.5 version, it works well.

    Is there anything I did wrong when doing the update?

    Thanks!
    Falk

    The page I need help with: [log in to see the link]

Viewing 14 replies - 1 through 14 (of 14 total)
  • Plugin Author Ajay

    (@ajay)

    I haven’t touched the block. What is the error that you get when you insert the block? I don’t see issues with my test install

    And, what are the settings of your block?

    • This reply was modified 3 years, 1 month ago by Ajay.
    Thread Starter fwmone

    (@fwmone)

    Thanks for your fast reply.

    I don’t get any error. Instead, it shows “This block will be shown empty” (roughly translated from German). The “related-posts” renderer returns HTTP 200 ‘rendered: “”‘.

    These are my settings: https://ibb.co/mRZMQXt

    Thread Starter fwmone

    (@fwmone)

    P. S. I found the problem. It’s in main-query.php:

    	if ( crp_exclude_on( $post ) ) {
    		return ''; // Exit without adding related posts.
    	}

    …because…

    // If the DO NOT DISPLAY meta field is set.
    	$crp_post_meta = get_post_meta( $post->ID, 'crp_post_meta', true );
    
    	if ( isset( $crp_post_meta['crp_disable_here'] ) ) {
    		$crp_disable_here = $crp_post_meta['crp_disable_here'];
    	} else {
    		$crp_disable_here = 0;
    	}
    
    	if ( $crp_disable_here ) {
    		return true;
    	}

    I disabled showing CRP automatically at the end of this specific page because otherwise the block makes no sense – I would get two blocks instead (the one I included manually and the other that would be added at the end of the page). Up to 3.0.5, this worked.

    • This reply was modified 3 years, 1 month ago by fwmone.
    • This reply was modified 3 years, 1 month ago by fwmone.

    Hey,

    I have the same problem.

    Best
    Cls

    Thread Starter fwmone

    (@fwmone)

    As a temporary solution, I commented out

    	// Check exclusions.
    	if ( crp_exclude_on( $post ) ) {
    		return ''; // Exit without adding related posts.
    	}

    in main-query.php. This seems to bring back how it worked before 3.0.6.

    Plugin Author Ajay

    (@ajay)

    Instead of the above, will you be able to make this change to the exclusions.php file to add these checks

    // If the DO NOT DISPLAY meta field is set.
    if ( ! $args['is_shortcode'] && ! $args['is_manual'] && ! $args['is_block'] ) {
    	$crp_post_meta = get_post_meta( $post->ID, 'crp_post_meta', true );
    
    	if ( isset( $crp_post_meta['crp_disable_here'] ) ) {
    		$crp_disable_here = $crp_post_meta['crp_disable_here'];
    	} else {
    		$crp_disable_here = 0;
    	}
    
    	if ( $crp_disable_here ) {
    		return true;
    	}
    }
    
    • This reply was modified 3 years, 1 month ago by Ajay.
    Thread Starter fwmone

    (@fwmone)

    Thanks for your reply. For this to work, you also have to make this change in main-query.php…

    	// Check exclusions.
    	if ( crp_exclude_on( $post, $args) ) {
    		return ''; // Exit without adding related posts.
    	}

    (add args argument to function call)

    Plugin Author Ajay

    (@ajay)

    Thank you @fwmone

    I’ll get that fixed as well and push an update shortly. Sorry for the confusion.

    I’m working on fixing that asap

    • This reply was modified 3 years, 1 month ago by Ajay.
    Thread Starter fwmone

    (@fwmone)

    Yes, I tested it in my environment thoroughly and it worked well.

    Plugin Author Ajay

    (@ajay)

    @fwmone

    I’ve been able to replicate this – also added the checks for another use of the crp_exclude_on function. Will push an update shortly.

    Plugin Author Ajay

    (@ajay)

    @fwmone @clsklvr

    v3.0.7 has been released which fixes this. Once again, apologies for breaking this feature.

    Great, thank you!

    Best
    Cls

    Thread Starter fwmone

    (@fwmone)

    Thanks a lot, tested it and it works well!

    Plugin Author Ajay

    (@ajay)

    Thanks both for confirming!

Viewing 14 replies - 1 through 14 (of 14 total)
  • The topic ‘3.0.6 breaks Related Posts block’ is closed to new replies.