Needs work
Project:
Flexinode
Version:
master
Component:
User interface
Priority:
Normal
Category:
Feature request
Assigned:
Unassigned
Reporter:
Created:
26 Dec 2005 at 01:31 UTC
Updated:
27 Jan 2007 at 14:05 UTC
Jump to comment: Most recent file
Comments
Comment #1
Bèr Kessels commentedThis is a bug. Its not possible atm.
Comment #2
bomarmonk commentedRelated? 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).
Comment #3
Bèr Kessels commentedbomarmonk: related, yes, but please file a separate issue for that.
Comment #4
egfrith commentedI'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!
Comment #5
egfrith commentedDoh! forgot to attach the patch. Here it is.
Comment #6
Bèr Kessels commentedSome 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.