Remove incorrect album_id filter from video theatre query#4904
Remove incorrect album_id filter from video theatre query#4904GaryJones wants to merge 2 commits intobuddyboss:releasefrom
Conversation
The video theatre AJAX handler passes album_id => 'existing-video' when querying for a specific video by ID. This value is interpreted as album_id = 0 by the query, restricting results to videos that do not belong to any album. Videos attached to an album are excluded, breaking theatre playback for album-associated videos. Since the query already filters by a specific video ID via the 'include' parameter, the album_id restriction is unnecessary and counterproductive. Remove it so all videos are found regardless of album association.
|
@claude Review the PR |
|
Claude finished @chetansatasiya's task in 1m 21s —— View job PR Review
SummaryThe fix is correct. The root cause is well-documented in the query layer at // existing-video check to query video which has no albums assigned.
if ( ! empty( $r['album_id'] ) && 'existing-video' !== $r['album_id'] ) {
$where_conditions['album'] = "m.album_id = {$r['album_id']}";
} elseif ( ! empty( $r['album_id'] ) && 'existing-video' === $r['album_id'] ) {
$where_conditions['album'] = 'm.album_id = 0';
}Passing The Change- 'album_id' => 'existing-video',
+ // Do not filter by album_id here. The 'existing-video' value
+ // restricts the query to videos with album_id = 0, which
+ // excludes videos that belong to an album.Verdict: Correct fix. The removal is sound and the comment clearly explains the intent and the footgun for future maintainers. The Minor Notes (Pre-existing Issues, Not This PR's Responsibility)
ConclusionThe fix is minimal, correct, and appropriately scoped. The explanatory comment is a good addition given how non-obvious the Approved. ✓ |
Problem
The video theatre AJAX handler in
bp-templates/bp-nouveau/includes/video/ajax.phppasses'album_id' => 'existing-video'when querying for a specific video by its ID. The query layer interprets this non-numeric value asalbum_id = 0, which restricts results to videos that do not belong to any album.This means that when a user clicks to view a video in theatre mode that is associated with an album, the query returns no results and playback fails silently.
Fix
Remove the
album_idparameter from the query arguments. The query already filters by a specific video ID via the'include'parameter, so the album_id restriction is redundant. Without it, videos are found regardless of whether they belong to an album or not.Test plan