Opened 11 years ago
Closed 11 years ago
#5343 closed defect (bug) (fixed)
wrong implementation of bp_group_current_avatar causes display error
Reported by: | plocha | Owned by: | imath |
---|---|---|---|
Milestone: | 2.0 | Priority: | normal |
Severity: | normal | Version: | |
Component: | Groups | Keywords: | has-patch reporter-feedback commit |
Cc: |
Description
The function setup_title() in 'bp-groups-loader.php' uses the return value of bp_group_current_avatar() to get the avatar html code. But instead of returning the html code bp_group_current_avatar() outputs it directly. In my BuddyPress installation this causes a 'No Group Avatar' message.
Attachments (2)
Change History (11)
#2
in reply to:
↑ 1
@
11 years ago
- Keywords reporter-feedback added
Hi @plocha
thanks for your feedback.
I've made some research, as the image "none.gif" is not in BuddyPress trunk version.
Untill 1.0.3 /bp-groups had a subfolder named image with the image "none.gif" in it.
In 1.1 "none.gif" was moved to /bp-groups/deprecated untill 1.2.
The $bp->bp_options_nav is used by bp_get_options_avatar() which seems to be deprecated
This function was used in bp-themes folder into the optionsbar.php template of these themes
- by bpmember & bpskeletonmember (1.0)
- bp-sn-parent in 1.1
It used has disappeared since bp-default in 1.2.
1) In my opinion, the function bp_group_current_avatar()
should echo the current group avatar by using a new function bp_get_group_current_avatar()
which would return the current group avatar.
In bp-groups-loader.php, line 594, i'm not sur we should use this function as normally, the same kind of thing is already done at line 585.
If line 594 is run, this means bp_core_fetch_avatar()
is returning nothing. Potential reasons can be that :
- Showing avatar has been disabled in WordPress discussion settings.
- current_group id is not set (< this would be strange).
2) So i think in this case we should simply fill $bp->bp_options_nav
with the default avatar.
Attached 5343.diff is doing what's describe at point 1) & 2)
@plocha
- (just to be sure) could you indicate in which version of BuddyPress your problem happens ? is it 1.9.1 ?
- In WordPress discussion settings is the Show Avatars options activated ?
#3
@
11 years ago
- Severity changed from minor to normal
The bug seems a lot more problematic.
if in WordPress Administration discussion settings the show avatars option is disabled then, when clicking on the group admin tab the redirection to group-edit is broken by the "none.gif" image
#4
follow-up:
↓ 5
@
11 years ago
- Milestone changed from Awaiting Review to 2.0
5343.diff looks like the right strategy to me.
imath - Have you confirmed that the redirect issue is fixed by 5343.diff?
#5
in reply to:
↑ 4
@
11 years ago
Replying to boonebgorges:
imath - Have you confirmed that the redirect issue is fixed by 5343.diff?
Yes i confirm.
Actually the redirect issue is fixed by the change in bp-groups/bp-groups-loader.php (first part of the patch)
For second part, i thought that there may be themes or plugins that are using the function bp_group_current_avatar()
#6
follow-up:
↓ 7
@
11 years ago
For second part, i thought that there may be themes or plugins that are using the function bp_group_current_avatar()
Possibly, but it looks like your patch wouldn't break them. By removing reference to the non-existent none.gif, it would *fix* them, right?
#7
in reply to:
↑ 6
@
11 years ago
Replying to boonebgorges:
Possibly, but it looks like your patch wouldn't break them. By removing reference to the non-existent none.gif, it would *fix* them, right?
Yes. The real problem as mentioned @plocha was that $bp->bp_options_nav
is using bp_group_current_avatar(). In the patch, i don't use it to instead use the default avatar. As if we end up here, then the group avatar was not found.
Then if bp_group_current_avatar() is used, it will output the avatar or nothing but no more the none.gif ;)
Sorry, my patch file seems to be laconic. It patches bp-groups-template.php