Show Sidebar Log in
Commons In A Box Logo
  • Home
  • About
    • Project Team
    • Logos and Graphics
  • Showcase
    • CBOX Classic Showcase
    • CBOX OpenLab Showcase
  • Demo
  • Get Started
  • Documentation
    • Technical Guide
    • CBOX Classic Guide
    • CBOX OpenLab Guide
  • Support Forums
    • CBOX Classic
    • CBOX OpenLab
    • Developers Forum
  • News

Group Admins

  • Profile picture of Scott Voth

CBOX OpenLab Support

Public Group active 1 year, 2 months ago

Have a question about Commons In A Box OpenLab, our new platform for open learning? Join the group and post your question here. Register for an account or log in to commonsinabox.org, then join the group and post your question here.

Group Discussion Board Administration

  • This topic has 5 replies, 2 voices, and was last updated 3 years, 11 months ago by S.G..
Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • June 2, 2021 at 4:51 pm #8878
    S.G.
    Participant

    <p data-pm-slice=”1 1 []”>Noted by one of our faculty users/Followed up by Chris Stein:

    When you create a topic and set the status to pending you can not edit the topic.</p>
    It seems that if you make a status of Pending, the link to the Topic doesn’t include the title of the topic which is why it isn’t going to the right thing. For example this is a non-working (just for illustration) link to what an Open Topic would look like, with the topic title at the end of the URL:

    https://openlab.bmcc.cuny.edu/groups/groupname/forum/topic/compensation/

    And here is the (non-working) link to a topic that is pending. The title of the topic is not included.

    https://openlab.bmcc.cuny.edu/groups/groupname/forum/topic/

    I don’t know if this is as expected and people are supposed to go into the dashboard to manage? That may be. But the problem is that on the OpenLab the bbPress Forum Dashboard is only accessible to super admins and is tied to the main Openlab site.

    June 2, 2021 at 5:25 pm #8879
    Ray
    Keymaster

    I can confirm this bug. It’s a problem with the BuddyPress integration with the bbPress forums plugin.

    For now, I would recommend that you do not use the “Pending” status option.

    I’ll see if I can code a workaround, but I’ll be posting a bug report to bbPress Trac. Will update this thread once I find out more.

    June 2, 2021 at 8:22 pm #8883
    Ray
    Keymaster

    I’ve posted the bug report to bbPress here: https://bbpress.trac.wordpress.org/ticket/3430

    Syelle, if you have access to your server, you can add the following snippet to wp-content/mu-plugins/ or wherever else you might store custom code as a temporary workaround:

    // Allow pending group topics to be viewed.
    add_action( 'bbp_before_group_forum_display', function() {
    	if ( 'topic' !== bp_action_variable() ) {
    		return;
    	}
    
    	add_filter( 'bbp_before_has_topics_parse_args', function( $retval ) {
    		if ( 0 !== strpos( $retval['name'], 'pending-' ) ) {
    			return $retval;
    		}
    
    		// Sanity check! Ensure that we have a post ID.
    		$id = substr( $retval['name'], 8 );
    		if ( ! is_numeric( $id ) ) {
    			return $retval;
    		}
    
    		// Sanity check 2: Ensure post is pending and user can edit post.
    		$topic = get_post( $id );
    		if ( 'pending' !== get_post_status( $topic ) && ! current_user_can( 'edit_posts' ) ) {
    			return $retval;
    		}
    
    		unset( $retval['name'] );
    		$retval['p'] = $topic->ID;
    
    		return $retval;
    	} );
    } );
    
    // Fix pending (and spam) group topic permalinks.
    add_filter( 'bbp_get_topic_permalink', function( $retval, $topic_id ) {
    	$topic = get_post( $topic_id );
    	if ( 'topic' !== $topic->post_type ) {
    		return $retval;
    	}
    
    	if ( 'pending' !== get_post_status( $topic ) && 'spam' !== get_post_status( $topic ) ) {
    		return $retval;
    	}
    
    	if ( ! bp_is_group() ) {
    		return $retval;
    	}
    
    	// Add 'pending-{$topic_id}' as slug for pending topics.
    	if ( 'pending' === get_post_status( $topic ) ) {
    		$retval .= sprintf( 'pending-%d', $topic_id );
    	}
    
    	return bbp_add_view_all( trailingslashit( $retval ), true );
    }, 20, 2 );
    
    // Fix redirect when posting a new pending group topic.
    add_filter( 'bbp_new_topic_redirect_to', function( $retval, $redirect, $topic_id ) {
    	if ( ! bp_is_group() ) {
    		return $retval;
    	}
    
    	$topic      = bbp_get_topic( $topic_id );
    	$slug       = trailingslashit( $topic->post_name );
    	$topic_hash = '#post-' . $topic_id;
    
    	// Pending status
    	if ( bbp_get_pending_status_id() === get_post_status( $topic_id ) ) {
    		$slug = bbp_add_view_all( sprintf( 'pending-%d', $topic_id ), true );
    	}
    
    	return trailingslashit( bp_get_group_permalink( groups_get_current_group() ) ) . 'forum/topic/' . $slug . $topic_hash;
    }, 20, 3 );
    June 3, 2021 at 12:29 pm #8885
    S.G.
    Participant

    Thanks, Ray! I’ll let Chris know.

    July 19, 2021 at 9:04 pm #8909
    Ray
    Keymaster

    Hi Syelle,

    We’re going to be including a fix for this in the next maintenance release for CBOX. We’re aiming for early August for the next release.

    See https://github.com/cuny-academic-commons/commons-in-a-box/issues/358 for all the forum fixes that will be included.

    July 20, 2021 at 1:36 pm #8910
    S.G.
    Participant

    Thanks for the update!

  • Author
    Posts
Viewing 6 posts - 1 through 6 (of 6 total)
  • You must be logged in to reply to this topic.
Log In
Group logo of CBOX OpenLab Support
  • Home
  • Forum
  • Announcements
  • Docs
  • Members 22
  • Send Invites

Groups

Newest | Active | Popular | Alphabetical
  • Group logo of CBOX Classic Support
    CBOX Classic Support
    287 members
  • Group logo of CBOX Pioneers
    CBOX Pioneers
    71 members
  • Group logo of CBOX Developers
    CBOX Developers
    40 members
  • Group logo of CBOX OpenLab Support
    CBOX OpenLab Support
    22 members
  • Group logo of CBOX-OL Testing Partners
    CBOX-OL Testing Partners
    12 members

CBOX has its roots in the CUNY Academic Commons, which in turn was made possible through funding from The City University of New York itself.

CUNY Logo

CUNY Academic Commons Logo

City Tech logo

The Commons In A Box was made possible through the generous support of the Alfred P. Sloan Foundation.

Alfred P. Sloan Foundation Logo

NEH Logo

The CUNY Graduate Center has directly contributed to the CUNY Academic Commons, housing the project since its inception, and has contributed to CBOX through its GC Digital Initiatives.

CUNY Graduate Center Logo

CUNY Graduate Center Digital Initiatives Logo

Powered by Commons In A Box
css.php
Skip to toolbar
  • About WordPress
    • WordPress.org
    • Documentation
    • Learn WordPress
    • Support
    • Feedback
  • Log In
  • Register