Jump to content


Photo

Disabling a blog is bad


It blows up lots of things.

The user whose blog is disabled is unable to access the forum, the admin can't edit the member through the ACP..

Basically, the rebuildMyBlogsCache function has a fit because

            while( $row = $this->DB->fetch( $o ) )
            {
                if ( empty($row['blog_disabled']) )
                {
                    /* Set type */
                    $row['_type'] = ( $row['blog_owner_id'] == $memberData['member_id'] AND ( ! $row['blog_groupblog'] ) ) ? 'owner' : $blogIds[ $row['blog_id'] ];
                   
                    /* If we are an editor, make sure the Admin allows this */
                    if ( $row['_type'] == 'editor' )
                    {
                        if ( ! IPSMember::isInGroup( $row, $aGroups, true ) )
                        {
                            unset($blogIds[ $row['blog_id'] ]);
                            continue;
                        }
                    }
                   
                    /* Set a flag for blogs we can actually post in */
                    $row['_canPostIn'] = ( in_array( $row['_type'], array( 'group', 'owner', 'editor' ) ) AND $row['blog_type'] != 'external' );
                   
                    /* Unset some data */
                    unset( $row['member_id'] );
                   
                    $blogs[ $row['blog_id'] ] = $row;
                }
            }

Winds up setting $blogs to empty, so, when it hits the next query

       	 $this->DB->build( array('select' => 'blog_id, count(*) as entries, SUM(entry_num_comments) as comments', 'from' => 'blog_entries', 'where' => 'blog_id IN (' . implode( ',', array_keys( $blogs ) ) . ')', 'group' => 'blog_id') );
 

It fails quite nastily.

Status: Duplicate
Version: 2.5.2
Fixed In:


1 Comments

http://community.inv...-viewing-blogs/

Package was already rebuilt with this fix and a manual one is provided as well.