Only show "delete picture" option if picture exists

ChrisKennedy - October 20, 2007 - 23:54
Project:Drupal
Version:6.x-dev
Component:user system
Category:bug report
Priority:normal
Assigned:Unassigned
Status:closed
Description

If pictures are enabled, the user edit page has two additional options: one to delete the current picture and one to upload a replacement picture. The delete option should only be shown if a picture already exists; if not the option is useless. This patch fixes this functionality.

AttachmentSizeStatusTest resultOperations
delete_picture.patch910 bytesIgnoredNoneNone

#1

m1mic - November 6, 2007 - 02:22
Status:needs review» reviewed & tested by the community

Tested with:

  • DRUPAL-6-0-BETA-2
  • PHP 5.2.1
  • Apache 2.0.59 (MAMP)

Patch works as advertised. Marking as RTBC.

#2

Gábor Hojtsy - November 6, 2007 - 08:54
Status:reviewed & tested by the community» fixed

Agreed, committed. The previous code was dependent on the theme function returning an empty string if there is no picture, but this might not be the case if for example you have a default picture or would otherwise return a placeholder anyway if there is no picture.

#3

Anonymous - November 20, 2007 - 09:01
Status:fixed» closed

Automatically closed -- issue fixed for two weeks with no activity.

 
 

Drupal is a registered trademark of Dries Buytaert.