Skip to:
Content

BuddyPress.org

Opened 11 years ago

Closed 11 years ago

#5150 closed defect (bug) (fixed)

Avatar uploaded successfully template notice persists

Reported by: henrywright's profile henrywright Owned by: boonebgorges's profile boonebgorges
Milestone: 1.9 Priority: normal
Severity: normal Version: 1.8.1
Component: Core Keywords: has-patch
Cc:

Description

  1. Upload an avatar via members/username/profile/change-avatar/
  1. If upload is successful a template notice "Your new avatar was uploaded successfully" will be displayed on the page
  1. Now navigate to the settings page (members/username/settings/) by clicking on the Settings link

You will see the "Your new avatar was uploaded successfully" message continues to display on the Settings page. If you now navigate away from the settings page the message disappears.

Attachments (2)

5150.patch (572 bytes) - added by henrywright 11 years ago.
5150.2.patch (567 bytes) - added by boonebgorges 11 years ago.

Download all attachments as: .zip

Change History (10)

#1 follow-up: @henrywright
11 years ago

Actually why does the member need to stay on the change avatar page after a successful avatar upload? Would it be better to redirect them to their profile which will display their new avatar - that in itself would serve as confirmation the upload was successful. I have opted to use this:

function bp_redirect_after_avatar_upload() {
	bp_core_redirect( bp_loggedin_user_domain() );
}
add_action( 'xprofile_avatar_uploaded', 'bp_redirect_after_avatar_upload' );

I know this doesn't resolve the issue but I'd be grateful for your thoughts...

Last edited 11 years ago by henrywright (previous) (diff)

#2 in reply to: ↑ 1 @DJPaul
11 years ago

  • Keywords reporter-feedback added

Replying to henrywright:

Actually why does the member need to stay on the change avatar page after a successful avatar upload? Would it be better to redirect them to their profile which will display their new avatar - that in itself would serve as confirmation the upload was successful. I have opted to use this:

I like this idea. Any dissenting opinion from other contributors here?

henrywright, do you want to/are you able to patch this up?

@henrywright
11 years ago

#3 @henrywright
11 years ago

Hi DJPaul

Please find a patch attached.

#4 @henrywright
11 years ago

  • Keywords has-patch added; reporter-feedback removed

#5 @boonebgorges
11 years ago

I'm a big fan of the new redirect. However, I'd like to keep the message too. The combination should fix the original issue, since the template_notices hook will always appear on the user profile. See 5150.2.patch.

#6 @boonebgorges
11 years ago

  • Milestone changed from Awaiting Review to 1.9

#7 @henrywright
11 years ago

boonebgorges just tested - works great and also fixes the original issue!

#8 @boonebgorges
11 years ago

  • Owner set to boonebgorges
  • Resolution set to fixed
  • Status changed from new to closed

In 7359:

After successful avatar crop, redirect to user domain

Previously, we'd redirected back to the Change Avatar page. But on a
successful crop, this is unneeded. Instead, we send the user back to
his profile, with a success message.

Fixes #5150

Props henrywright

Note: See TracTickets for help on using tickets.