robertstaddon (@robertstaddon)

Forum Replies Created

Viewing 5 replies - 1 through 5 (of 5 total)

  • robertstaddon
    Participant

    @robertstaddon

    This typo still exists, which continues to publicly display Private or Scheduled sticky posts in the latest version of bbPress 2.6.4.

    It can be easily fixed by correcting line 404 of the “bbpress/includes/topics/template.php” file to set $sticky_query[‘perm’] instead of $sticky_query[‘post_status’].

    This is the correct code that works:

    
    // Allowed statuses, or lean on the 'perm' argument (probably 'readable')
    $sticky_query['perm'] = bbp_get_view_all( 'edit_others_topics' )			? 
      $r['post_status']
      : $r['perm'];
    

    robertstaddon
    Participant

    @robertstaddon

    I have the exact same problem as @artmuns on a brand new WordPress install. I’m running just the latest version of bbPress 2.6.4 with the latest version of WordPress and no other plugins on the default WordPress theme. On the Edit Topic screen, I can go to “Topic Attributes” and change the “Type” to “Sticky” or “Super Sticky”. However, once a topic type has been changed to “Sticky” or “Super Sticky”, if I try changing it back to “Normal” and then click “Update”, it will not change. I have to either go to the frontend or to the listing of All Topics and click “Unstick” to change the Topic type to something besides “Sticky”. This is definitely a bug with bbPress!


    robertstaddon
    Participant

    @robertstaddon

    Correct! Changing line 303 to what you put above does fix the issue.


    robertstaddon
    Participant

    @robertstaddon

    Here is the incorrect piece of code that is currently there:

    	// Lean on the 'perm' query var value of 'readable' to provide statuses
    	} else {
    		$sticky_query['post_status'] = $r['perm'];
    	}

    And here is how the code should read:

    	// Lean on the 'perm' query var value of 'readable' to provide statuses
    	} else {
    		$sticky_query['perm'] = $r['perm'];
    	}

    robertstaddon
    Participant

    @robertstaddon

    Thank you, @robin-w!

    So I found found the cause of the bug. There is a typo on line 303 of the “bbpress/includes/topics/template.php” file in the latest version of bbPress (2.5.14). It tries to set the “post_status” query value to “readable”. This is an invalid value for “post_status”. What the programmer intended was to set the “perm” query value to “readable”.

Viewing 5 replies - 1 through 5 (of 5 total)