Closed (won't fix)
Project:
Content Construction Kit (CCK)
Version:
5.x-1.x-dev
Component:
text.module
Priority:
Normal
Category:
Feature request
Assigned:
Unassigned
Reporter:
Created:
28 Aug 2006 at 20:57 UTC
Updated:
29 Jun 2009 at 03:38 UTC
Jump to comment: Most recent file
Comments
Comment #1
dodorama commentedI like this. go testing ASAP.
Comment #2
fagoNice little feature.
Patch applies clean to cck head and with offset to cck 4.7 and does its job :)
Comment #3
crizcool, would be useful for other multiple fieldtypes too...
Comment #4
marcoBauli commentedhowdy,
you think this would be somehow easily implementable for the imagefield as well?
(when i asked this feature for imagefield i was told it was a task of core cck, not of single field type)
thx
Comment #5
mh86 commentedyes, this feature is also possible for other field types! If there is the need for, it would be better to put this into the cck core and then it would be available for all fields!
Comment #6
fagobut what if a select widget is used? in this case the field doesn't suit.
Comment #7
dodorama commentedTrue. But select list doesn't allow multiple values whatever you apply this patch or not. As I posted here this is a kind of bug (or usability issue).
Comment #8
karens commentedOne approach to this would be to put this in the widget rather than the field. That way it only is an option if the optionwidgets widget is not used. Irregardless of any bugs in optionwidgets, you can't control how many items are selected in a multiple select list, so as fago says, it doesn't make sense in that situation.
I'd prefer to find something that could be done generically in the content module instead of altering each individual field module to do this, but this may not make sense since it depends on things like whether a select list is being used.
Comment #9
karens commentedAs I think about this more, I realize that we also need to think about where the 'multiple' option is displayed. Maybe both the multiple checkbox and an option for the number of multiple fields belongs in the widget rather than the field, since they seem to go together, i.e. optionwidgets is going to use the multiple select checkbox to control whether multiple select fields or checkboxes are offered and won't need to know how many option should be allowed, while a multiple option on a plain taxtfield should perhaps allow you to choose the number of items to create and maybe a different label for each one. An example would be a phone number field where you might want to show a home and work number as a multiple value textfield.
Comment #10
blockedmind commentedIs there any patch for Drupal 5 does the same thing? This is inadaptable to version 5.
Comment #11
seanberto commentedI certainly don't have the skills to do this, but what about using javascript to hide multiple fields - as the civicrm module does. You could let the Drupal admin set a max # of fields, but then hide them on the add/edit form with a button to display X number of fields.
Better yet, what if ajax was used to create additional fields from the edit form?
I'm a newbie - so this might all be a pipedream.
But I really like where this is going!
Comment #12
rickvug commentedJust bumping this and adding my support. In http://drupal.org/node/103544 I state my case as to why. Now comes the "how" part. I makes sense to add this support in a universal fashion not just on a case by case basis.
Comment #13
karens commentedMarked http://drupal.org/node/124075 as duplicate.
Comment #14
macm commentedsubscribing. Nice idea.
Comment #15
moshe weitzman commentedwould be useful ... subscribing
Comment #16
ray007 commentedsubscribing
Comment #17
profix898 commentedMarked http://drupal.org/node/139657 as duplicate.
Comment #18
xamountsubscribing
Comment #19
dami commentedI can think of a few use cases:
1. Fixed number of multivalue fields:
An easy (may not so good) hack may be change field['multiple'] to textfield instead of checkbox, then use it to configure how many addition instances/multivalues are needed for this field. (0 means 'not multiple).
2. Expand on the fly:
It'd also be great to have dynamic expandable field, like what ahah_form does. Maybe we can reuse some of the code there or simply build it upon ahah_forms ?
3. Number of multivalue field depends on another CCK field value.
One use case maybe if we want to record a soccer game. We'll have a CCK number fields (interger) for each team's total score X. Then we will have another CCK field (X instances) for specific info of each score/goal.
Comment #20
ray007 commented@dami
ad 1) and a special value like -1 for 'unbounded'? we should also think about something to specify a minimum and maximum
ad 2) have only tested ahah_forms very lightly, but sounds good to me
ad 3) sounds like yet another good place to use the token module
Comment #21
StevenSokulski commentedSubscribing
Comment #22
webchickSub.
Comment #23
profix898 commentedFor Drupal 6 this issue could also be solved using AHAH to add more fields if requested by the user. Similar to http://drupal.org/node/155870 which adds additional choices to poll.module form ...
Comment #24
bsuttis commentedAny one got this patch working in 5.1?
I applied it manually, and I can choose how many fields I want, and add and remove values in the fields without issue.
However, if my fields value is set at 5 and I fill in all 5, submit, and re-edit the node, I see that a new field has been added (making 6 fields shown, with the bottom 2 empty), and the 5th field has had its value removed.
I only noticed a couple differences in the actual patching of the 5.1 version, so I didn't think there'd be any problem, but there appears to be a couple issues. I tried the patching a couple times and get the same results. Just interested if anyone has got it working in 5.1, this is a really useful option.
Comment #25
gubilla commentedsub.
Comment #26
Caleb G2 commentedsubscribing. I looked around for about an hour before finding this thread. Was surprised to find that this isn't a feature of cck and/or a current contrib...
Comment #27
tonyn commentedSub.
Comment #28
rickvug commentedWith the AHAH form api stuff going into Drupal 6 core hopefully this will be built right in. For more information on what the framework is see the Drupal 4.7 module: http://drupal.org/project/ahah_forms.
Comment #29
rapsli commentedWhen do you guys think it will be part of cck text. I really need this function:
Anybody working on it? The patch only gives me the permission to give a fixed number of text fields, plus with 5.2 there's a bug, when editing a node.
Comment #30
yched commentedThis will be much easier to do with the (currently in progress) CCK for D6, and won't happen in 5 branch.
Comment #31
benwei commentedsubscribing.
Comment #32
tormu commentedThe Link fieldtype has this function implemented. When I check the "multiple values" from the field with type "link", it will have "More Links"-button under the second field. Pressing the button makes a new line come up without submitting the form. Couldn't this be brought fairly easily to Text field too?
Comment #33
tormu commentedSince I'd really be needing this feature I got a bit into it and tried importing the functionality from the link.module.
I got it working but I'm 99.892% sure there are many things that needs to be taken into account and that this will fok them up.. But maybe someone from the text.module team could have the time to look into it. Attached is the current text.module I have, which uses the link.js file from the link module and contains roughly copy-pasted and altered stuff from the link.module.
Modifications
- new stuff at the beginning of text_widget() [also notice the + 2 changed to + 0 in row 320] and
- new function _text_widget_form()
Comment #34
karens commentedThis feature (implemented differently than in this patch) is now in HEAD for the D6 version of CCK. In that version you can now either select that you want a specific number of multiple fields, or that you want unlimited multiples. If you select unlimited multiples, you get a nice AHAH add more button to add as many fields as you like.
Marking fixed because this is now in HEAD. It would be quite difficult and messy to get this working in D5, so it probably won't be back-ported.
Comment #35
bsuttis commentedI'm getting a 'warning: Cannot use a scalar value as an array in ...sites\all\modules\cck\content.module on line 587.' error when submitting a node using the updated code in #33, the values in the added fields aren't saved either -- any ideas why?
Comment #36
scottrigbysubscribe - thx
(in particular, I'd be interested in further developments on #33 patch for Drupal 5.3)
Comment #37
scottrigby@#33
I'd like to test, but am I dong this right?
(from text.info: version = "5.x-1.6-1")
- I disabled CCK Text in Administer > Modules
- replaced text.module with the one downloaded from #33
- enabled CCK Text in Admin > Mods again
- I opened a listing which I hadn't previously added anything in the text fields I wanted to test
- Added some info
- Here's the error:
- It didn't add a new field.
- Also, it refreshed and jumped back to the top of the page (my thought was - this isn't very ajaxy)
Let me know if I can modiy anything to help test - this would be a great feature if we can get it to work --
Scott
Comment #38
karens commentedThis issue is about adding this feature to HEAD, which has been done. And both yched and I have posted to say that it would not be easy to do this in 5.x so it is not likely to get back-ported. So this issue is fixed and done.
If people want to play around with a method of getting this working reliably for all possible (or selected) field types in 5.x (a difficult task), I suggest you collaborate by creating an issue in the CCK group on groups.drupal.org. Just keep in mind that it is very likely that your work won't get into an 'official' version of CCK, at least unless someone comes up with a simple, easily maintainable method that has been proven to work even on complex fields. That is to say, getting it to work on the text module is only the very tip of the iceberg.
I'm not trying to be negative on the subject, it's a feature I'd like to see, too. But none of the CCK maintainers has time to create, debug, or maintain this, unless someone else does all the work for us :)
Comment #39
scottrigbyOk - I was just testing the patch. Apologies for getting off track here.
But -- since D6 isn't production ready yet, and this would be a very helpful feature that I saw people here are already working on -- I'd like some way of finding out about any new developments.
So -- if anyone reading this thread finds out any new developments about this feature -- I'd be appreciative if you'd post a link here as a follow-up.
Thanks, & good luck this feature in HEAD
Scott
Comment #40
(not verified) commentedAutomatically closed -- issue fixed for two weeks with no activity.
Comment #41
icecreamyou commentedIs there any reason this couldn't be implemented in 5.x the following way:
Instead of adding new fields in an AJAX-y interface, just add new fields when the Preview button is clicked? That would be exponentially better than clicking Submit and then Edit each time, and it would work just like the Poll module currently does.
Check out hook_form() in the Poll module in D5.7, which uses this code to do what I've described above (at least, I think it's this - I'm no programmer):
'morechoices' comes from this:
Thoughts? It seems like this should be easily doable.
Comment #42
yched commentedChanging version, then.
Bottomline is : in CCK D5, such a solution would have to be implemented separately by all field modules. I'm personnally not planning on doing any work on this, and, as Karen stated in #38, a patch pushing this kind of feature in the D5 branch would have to be clean and easily maitainable to be considered for committing.
Comment #43
Rosamunda commentedSuscribing
Comment #44
janwari commentedSubscribing
Comment #45
karens commentedA very old feature request for D5, won't do anything with this now.