Hi,

When you edit your account information, it is possible to upload a new avatar picture for your account. This works fine, except when you also check the "delete picture" box which is meant to delete your current picture. When this box is checked, your current picture is deleted but any new picture you're attempting to upload isn't saved.

Cheers,
Stella

Comments

stella’s picture

ping

roper.’s picture

I also need a fix for this. :-)

roper.’s picture

Nothing..? Seems pretty important... :|

ricabrantes’s picture

Version: 5.2 » 6.x-dev
Status: Active » Fixed

In D5.x-dev, if i upload a new avatar image, is are define but still in server. D6.x-dev, the old image is deleted..

Fixed in D6.x-dev

roper.’s picture

Cool, but what about 5.x?

No one has a fix?

ricabrantes’s picture

StatusFileSize
new502 bytes

I wrote a little patch for you.. please tell me if solved your problem..

magico’s picture

Version: 6.x-dev » 5.x-dev
Status: Fixed » Needs review
ricabrantes’s picture

@gstash: You test my patch??

drumm’s picture

Version: 5.x-dev » 7.x-dev
Status: Needs review » Needs work

This issue does still exist in 6.x and HEAD and is reproducible with the original description- check Delete picture and upload a new picture.

roper.’s picture

Woah, forgot about this for a while... Sorry.

@ricabrantes: I tested, but to no avail. The problem is that the NEW picture is not uploaded when "delete picture" is also checked. So we need something like "if delete is checked AND a new picture is being added, simply overwrite with the new image"

Or something... Thanks though. :-)

Fixdit’s picture

Version: 7.x-dev » 5.7

The patch attached here, does anyone know if it works? Needs to be a fix for this as it's pretty fundamental in any user led site.
Cheers!

stella’s picture

Version: 5.7 » 7.x-dev
stevenpatz’s picture

have you tested it?

dave reid’s picture

Revised patch for 7.x that is tested and works.

dave reid’s picture

Assigned: Unassigned » dave reid
Status: Needs work » Needs review
Fixdit’s picture

Will this work for 5.x? Is there something for 5.x? Cheers,
Beechyboy

dave reid’s picture

Status: Needs review » Needs work

The last submitted patch failed testing.

dave reid’s picture

Status: Needs work » Needs review
StatusFileSize
new972 bytes

Updating patch with a test to make sure this doesn't regress again. As of now, has 1 fail. Not sure why. Letting testing bot have a try.

Fixdit’s picture

What are users to do for now? Is there a hack or work around? I'm looking at using form_alter to unset("the delete checkox");
What do people think?

Status: Needs review » Needs work

The last submitted patch failed testing.

dave reid’s picture

Version: 7.x-dev » 6.x-dev
Issue tags: +user pictures

#357403: Move user picture to managed files has fixed this in D7, so moving back for D6.

dave reid’s picture

Title: edit account - "delete picture" prevents uploading of new picture » User picture fixes and cleanup
Status: Needs work » Needs review
StatusFileSize
new4.35 KB

Backports the improvements from #357403: Move user picture to managed files which got the ok from webchick in 7.x:
- User picture form cleanup
- Fixes #173493: User picture fixes and cleanup

Please help review and mark as RTBC if it's ready.

dave reid’s picture

Issue tags: +backport
Fixdit’s picture

Version: 6.x-dev » 5.7

Looking forward to backport to 5. How could I go about helping?

stevenpatz’s picture

Version: 5.7 » 6.x-dev
dave reid’s picture

Status: Needs review » Needs work
+    $form['picture']['picture_current'] = array(
+      '#markup' => theme('user_picture', (object)$edit),
+    );

Needs to be '#value' => ...

Fixdit’s picture

So in 5.x it should be... Right?

<?php
+    $form['picture']['picture_current'] = array(
+      '#value' => theme('user_picture', (object)$edit),
+    );
?>
andypost’s picture

Status: Needs work » Needs review
StatusFileSize
new1.04 KB

Suppose it's enough to clean checkbox value if user picture was saved

andypost’s picture

StatusFileSize
new2.24 KB

Another cleanup, $form_state['values']['form_build_id'] is saved to data

andypost’s picture

re-tagging

andypost’s picture

StatusFileSize
new2.24 KB

Re-roll against current D6

andypost’s picture

Dave Reid, can you review this? I think this is a useful cleanup

andypost’s picture

Priority: Normal » Major

patch still applies with offset

NROTC_Webmaster’s picture

StatusFileSize
new1.85 KB

re-rolled but assuming this will just be closed anyways.

dave reid’s picture

Assigned: dave reid » Unassigned

Status: Needs review » Closed (outdated)

Automatically closed because Drupal 6 is no longer supported. If the issue verifiably applies to later versions, please reopen with details and update the version.