Index: src/bp-core/bp-core-attachments.php
===================================================================
--- src/bp-core/bp-core-attachments.php
+++ src/bp-core/bp-core-attachments.php
@@ -976,21 +976,23 @@
 function bp_attachments_get_template_part( $slug ) {
 	$attachment_template_part = 'assets/_attachments/' . $slug;
 
-	// Load the attachment template in WP Administration screens.
-	if ( is_admin() && ( ! defined( 'DOING_AJAX' ) || ! DOING_AJAX ) ) {
-		$attachment_admin_template_part = buddypress()->themes_dir . '/bp-legacy/buddypress/' . $attachment_template_part . '.php';
+	$switched = false;
 
-		// Check whether the template part exists.
-		if ( ! file_exists( $attachment_admin_template_part ) ) {
-			return false;
+	/*
+	 * Use bp-legacy attachment template part for older bp-default themes or if in
+	 * admin area.
+	 */
+	if ( ! bp_use_theme_compat_with_current_theme() || ( is_admin() && ( ! defined( 'DOING_AJAX' ) || ! DOING_AJAX ) ) ) {
+		$current = bp_get_theme_compat_id();
+		if ( 'legacy' !== $current ) {
+			bp_setup_theme_compat( 'legacy' );
 		}
+	}
 
-		// Load the template part.
-		require( $attachment_admin_template_part );
+	bp_get_template_part( $attachment_template_part );
 
-	// Load the attachment template in WP_USE_THEMES env.
-	} else {
-		bp_get_template_part( $attachment_template_part );
+	if ( $switched ) {
+		bp_setup_theme_compat( $current );
 	}
 }
 
