Opened 10 years ago
Closed 10 years ago
#5999 closed defect (bug) (fixed)
Notice when uploading a group avatar with WP Trunk (4.1)
Reported by: | imath | Owned by: | imath |
---|---|---|---|
Milestone: | 2.2 | Priority: | normal |
Severity: | normal | Version: | |
Component: | Groups | Keywords: | has-patch commit |
Cc: |
Description
Using WordPress latest trunk (4.1), I have a _doing_it_wrong
each time i upload a group avatar. No BuddyPress functions seems to be in the process. So i wonder if it's a BuddyPress or a WordPress bug. Here's a screen cap of my xdebug notice :
Attachments (2)
Change History (9)
This ticket was mentioned in Slack in #buddypress by imath. View the logs.
10 years ago
#3
@
10 years ago
Nice find!
'parse_query' logic looks good. IMO, we don't need a function bp_core_avatar_is_crop_step()
- I'd suggest moving the logic into the bp_core_avatar_reset_query()
function.
#4
@
10 years ago
I'm not sure why you need to cast the value of bp_is_group_admin_screen
and group-avatar' == bp_action_variable( 1 )
to bools; they both return bools anyway. I think you can also use ===
here safely.
Actually the problem is happening each time an avatar is being cropped. In this step, a form is sending a
$_POST['w']
variable thatWP_Query
is interpreting as a 'week' parameter. After chatting with boonebgorges, as the form is built inside the templates :It seems the best solution is to reset the week query var. See 5999.patch