Remove existing image from existing node without replacing it.

simon rawson - December 26, 2005 - 01:31
Project:Flexinode
Version:HEAD
Component:User interface
Category:feature request
Priority:normal
Assigned:Unassigned
Status:needs work
Description

I have searched the site and this projects issues but I can't find any answers to this. Has the removal of an uploaded image of file from a flexinode not been included in the interface? Any workarounds available?

Thanks for help,

Simon

#1

Bèr Kessels - December 26, 2005 - 10:03
Category:support request» bug report

This is a bug. Its not possible atm.

#2

bomarmonk - December 29, 2005 - 19:26

Related? If an image is required, but already exists, editing the flexinode requires that you replace the exisitng image. You should be able to edit the flexinode without uploading an image each time (if the required image is already submitted).

#3

Bèr Kessels - December 29, 2005 - 21:10

bomarmonk: related, yes, but please file a separate issue for that.

#4

egfrith - June 18, 2006 - 21:40
Status:active» needs review

I'm attaching a patch to fix this issue. The basic idea is:
* In flexinode_field_image_form() incorporate the existing file form element into a fieldset that, once a file has been uploaded, also cotains a delete checkbox
* When an image has been uploaded and the form is submitted, flexinode_field_image_execute() checks to see if delete has been checked, and if so calls flexinode_field_image_delete() (an existing function).

The patch works against the HEAD version of flexinode. I've checked it against the coding conventions and it seems to be OK - but bear in mind I'm a relative rookie!

#5

egfrith - June 18, 2006 - 21:42

Doh! forgot to attach the patch. Here it is.

AttachmentSize
flexinode-image-remove.patch.txt 1.51 KB

#6

Bèr Kessels - January 27, 2007 - 14:05
Category:bug report» feature request
Status:needs review» needs work

Some things to do:
Don't use an empty description, and never surround it with a t(): #description' => t('')
Consistently use single quotes for simple strings: '#title' => t("File")
Consistently use spaces around concatanations: $fieldname . '-remove'

In general: the idea is good, the code needs attention.

 
 

Drupal is a registered trademark of Dries Buytaert.