This is a great module offering much needed functionality. However - on my /user/*/edit pages I have 3 tabs:

Account settings | Display Information | My newsletters

The 'Upload picture' link generated by Avatar crop appears under each tab. I'm not sure if this is a bug or by design - but I only want this to appear once.

Any ideas / work arounds?

CommentFileSizeAuthor
#7 avatar_upload_picture_link_fix.patch543 byteskyle_mathews

Comments

plan9’s picture

OK - I worked out a fix for this.

Although I'm probably the only person on the planet using the 5.x version of Avatar Crop I'm going to post my solution here anyway just in case it helps someone else:

Changed lines 345 - 347 from:

 function avatarcrop_form_alter($form_id, &$form) {

if ($form_id == 'user_edit') {

To:

function avatarcrop_form_alter($form_id, &$form, $form_state) {

if($form_id == 'user_edit' && arg(3) == NULL) {

plan9’s picture

Actually it's just the second line (347) that needs to be changed.

mmachina’s picture

have any ideas for how to fix 6.x version?

drupalina’s picture

Version: 5.x-1.0-beta2 » 6.x-1.4

@mmachina,
for 6.x fix , on line 303, where it says

if ($form_id == 'user_profile_form' && isset($form['picture'])) {

simply change that to

if ($form_id == 'user_profile_form' && isset($form['picture']) && arg(3) == NULL) {

(in human words that last bit means that the 4th part of the uri is empty)

mmachina’s picture

Hi Drupalina,

Thanks for the FIX!!! It worked great!

Exploratus’s picture

Worked for me to. I was getting the add image link on every user edit tab - but this fix worked!

kyle_mathews’s picture

StatusFileSize
new543 bytes

Thanks drupalina for the fix. Attached is a proper patch.

avpaderno’s picture

Version: 6.x-1.4 » 6.x-1.x-dev
Issue summary: View changes
Status: Active » Closed (outdated)

I am closing this issue, as Drupal 6 is now not supported.