Download & Extend

Remove existing image from existing node without replacing it.

Project:Flexinode
Version:master
Component:User interface
Category:feature request
Priority:normal
Assigned:Unassigned
Status:needs work

Issue Summary

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

Comments

#1

Category:support request» bug report

This is a bug. Its not possible atm.

#2

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

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

#4

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

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

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

#6

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.

nobody click here