Reduce standard 2 upload sections to 1 when "Unlimited" number of values

artatac - February 27, 2009 - 22:48
Project:FileField
Version:6.x-3.x-dev
Component:User interface
Category:feature request
Priority:normal
Assigned:Unassigned
Status:closed
Description

I have number of values set to unlimited, but when I go to create story I have 2 upload sections and under them [Add another item]. 99% of the time my users will only be putting in one picture so I would like to show just one upload section, with another only appearing IF the [Add another item] is clicked. I am trying to make the create content form as simple for my users as possible - can you advise please. I attache a visual for clarity

AttachmentSize
oneupload.png14.24 KB

#1

quicksketch - February 28, 2009 - 00:08
Project:ImageField» FileField
Version:6.x-3.0-alpha4» 6.x-3.x-dev
Category:support request» feature request

I agree that this is definitely a usability problem. The "two default fields" is actually caused by CCK, which has this behavior for all multiple value fields. But I definitely agree that we should only show one upload field at a time, especially since uploading two files at once can cause problems.

This is actually a problem caused by FileField which provides the default field used by ImageField, so I'm moving this issue over there.

#2

artatac - February 28, 2009 - 08:11

Thanks for the prompt response

#3

quicksketch - March 10, 2009 - 18:04
Status:active» postponed

Turns out this is already fixed in CCK in the #196421: Deleting unwanted multiple values / multiple values delta issues patch. I think we'll be best off to just wait for that issue to complete.

#4

quicksketch - March 19, 2009 - 02:33
Status:postponed» fixed

Oh nope, turns out I fixed this accidentally in #397578: Uncouple ImageField from FileField Custom Hooks. Though I'm not entirely sure how. See the screenshot, both fields are unlimited value fields.

AttachmentSize
filefield-single.png 22.54 KB

#5

quicksketch - March 24, 2009 - 23:27
Title:reduce standard 2 upload sections to 1» Reduce standard 2 upload sections to 1 when "Unlimited" number of values
Status:fixed» postponed

Well this seems to effect ImageFields but not FileFields. I'm putting this back to postponed until I can figure out where this is coming from.

#6

quicksketch - April 12, 2009 - 02:03
Status:postponed» fixed

Alright, I finally found a way to ensure FileField starts with exactly one upload field in all cases. CCK checks the $form_state['item_count'] variable for every field and then bases the number of fields based on that value (if it exists), then adding 1. So by setting this value to 0, we can ensure that CCK only adds one field every time.

AttachmentSize
filefield_default_values.patch 1.96 KB

#7

System Message - April 26, 2009 - 02:10
Status:fixed» closed

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

#8

artatac - April 27, 2009 - 17:02

Thank you - will this be incorporated within the standard (current module) or remain as a patch to be applied?

#9

DeFr - June 15, 2009 - 16:58

For the record, this conflicts with the latest CCK 6.x-3 development branch where #196421: Deleting unwanted multiple values / multiple values delta issues was fixed: with the patch, there's exactly as many upload fields as the default item_count, which means that there's now 0 upload field by default.

#10

techlive - June 23, 2009 - 09:24

Why Shall We make it default to 1???
in Version 3 development ,if it set to 0,there case an php error warning.......

#11

c_s_c - October 8, 2009 - 12:15

Hello everyone.

It seems to concern more than Imagefields or Filefields. I encounter the same difficulty with 'unlimited' location fields (from Location and GMap modules).
I am using Location 6.x-3.1-rc1 with Location CCK activated.

How can this be corrected ? What functions are acting wrong ?

 
 

Drupal is a registered trademark of Dries Buytaert.