Early Bird Registration for DrupalCon Portland 2024 is open! Register by 23:59 PST on 31 March 2024, to get $100 off your ticket.
My client is always entering at least 20 lines so they are forced to click the Add more values button a lot. It would be nice if they could start with 25 lines and then add more if they needed.
This patch is sort of similar in the sense that it adds the button to Limited groups: http://drupal.org/node/344587
Comment | File | Size | Author |
---|---|---|---|
#42 | Skærmbillede 2011-08-25 kl. 21.38.03.png | 24.77 KB | ulrikls |
#41 | cck-multi_initial_and_per_click-841914-5.patch | 25.72 KB | Alphabool |
#4 | cck-multi_initial_and_per_click-841914-4.patch | 24.71 KB | Agileware |
Comments
Comment #1
interestingaftermath CreditAttribution: interestingaftermath commentedComment #2
Junro CreditAttribution: Junro commentedsubscribe, Multigroup should really have this option.
Comment #3
interestingaftermath CreditAttribution: interestingaftermath commentedHi Junro, sounds like we are in the same boat. Here's what I've been trying (from my other issue):
Comment #4
Agileware CreditAttribution: Agileware commentedHere is a patch that allows this functionality.
For multiple entry fields it adds options to set how many elements display initially and how many elements are added per click of the add more button.
It works when using a limited number of entries or for unlimited.
The same options are also added to multigroup fieldsets.
After applying the patch you have to run update.php for content and content_multigroup modules.
The same patch could be done for cck 6.x-2.x-dev if the content_multigroup parts are pulled out but I haven't had the time to make it yet.
Work on this patch was sponsored by interestingaftermath.
Comment #5
Agileware CreditAttribution: Agileware commentedComment #6
Junro CreditAttribution: Junro commentedPatch works great! Thanks a lot :)
Comment #7
Junro CreditAttribution: Junro commentedI think the patch will not work with the new 3.x dev version.
No visible changes in content.node_form.inc but content.module has change a lot.
Try to port the patch to the new dev version is a pain in the....
@ Agileware
If you update the 3.x dev version and make the changes, could you attach your new content.module please.
Thanks :)
Comment #8
SeanA CreditAttribution: SeanA commentedWorks as advertised (with cck-3.x of August 14 2010). The only problem I noticed is in the code comments, in 2 places it says "Make sure the initial value is >= the multiple value" it should be "Make sure the initial value is <= the multiple value". That is, it should read 'less than' instead of 'greater than'. Otherwise, nice work!
I've posted a patch for 2.x here: #530828: Provide "Add more values" button for fields (and multigroups) with fixed number of multiple values
Comment #9
Agileware CreditAttribution: Agileware commentedIf that is just a port of the patch here it really should go in this issue and the other issue be made a duplicate of this one.
Comment #10
hey_germanoThe patch in #4 is working great for me so far. Multigroup changed my (drupal) life, and this makes it even better. Thanks!
Comment #11
SeanA CreditAttribution: SeanA commentedAgileware, since there are separate 2.x and 3.x branches, and the differences between them affect this feature, I posted the 2.x patch in the older issue.
This feature is a must-have for cck, it's important to be able to specify the way the form is output to the user. Fixing it with your approach should take care of some related/duplicate issues as well:
#320313: CCK multiple values: two empty fields showing up - make it one or none?
#318307: multiple values: starting with one, not two tables
#787196: "Add another" for unlimited values starts with 2 fields
#777574: Custom default value for Multigroup is currently max 10 or Unlimited
Comment #12
interestingaftermath CreditAttribution: interestingaftermath commentedGlad to hear I wasn't the only one in need of this feature. Agileware comes through again! :)
Comment #13
Anonymous (not verified) CreditAttribution: Anonymous commentedSubscribing.
Comment #14
DarkLight CreditAttribution: DarkLight commentedRequesting!! :)
Comment #15
jibize CreditAttribution: jibize commentedThank you interestingaftermath!
I think it would definitely be big plus to add these options to cck 3.x.
Comment #16
interestingaftermath CreditAttribution: interestingaftermath commentedHey guys, I am not sure if the issue I am having is with the multigroup module or because of this patch.
Have any of you tried to add more than 80 lines to a node? I have had 3 clients that are using this patch mention that when they try to add more than 80 they get something like this:
An HTTP Error 500 occurred./content_multigroup/js_add_more/order/group_order
Any ideas?
Comment #17
SeanA CreditAttribution: SeanA commentedI was able to add about 120 lines to a node on my test site with no problems. My multigroup field only has 2 items (so far), a text field and a select list... are your multigroups more complex? Are all the sites on the same host? Maybe PHP is running out of memory, you can check the limit on the status report page. If you google drupal php.ini memory you can find ways to increase it.
Comment #18
interestingaftermath CreditAttribution: interestingaftermath commentedSeanA: Good idea. All of the sites are on the same host, so I will check into the php memory. My multigroups are more complex with 6-7 text fields and a select list. I hope that's all it is but I will report back. Thanks!
Comment #19
interestingaftermath CreditAttribution: interestingaftermath commentedSeanA: My PHP memory was set to 32mb and I increased it to 128mb. This allowed me to go much higher (160 and then I got bored so I gave up) but my browser feels like it's going to die at any minute. It freezes up and takes forever to load the next 20 lines. I imagine this is because of all the fields I have but I'm not sure why it gets slower as I go higher. Any thoughts?
Comment #20
TimelessDomain CreditAttribution: TimelessDomain commentedjust applied this patch from #4. the form doesn't save the options though, so it is impossible to tell if the rest of the coding works. any suggestions? when will this be committed?
Comment #21
SeanA CreditAttribution: SeanA commentedinterestingaftermath, it may be due both to the javascript tabledrag stuff and also the way "add more" with cck multigroups works. The whole table has to be rebuilt when adding new elements, for the gritty details see the code and comments in function content_multigroup_add_more_js in content_multigroup.node_form.inc.
Patient: "Hey doc, it hurts when I do this."
Doctor: "Don't do that." ;-)
Timeless Domain, there are database updates with the patch (new fields to save the options)-- did you run update.php?
Comment #22
Marko B CreditAttribution: Marko B commentedI need this as well, thanx for patch.
Comment #23
alit CreditAttribution: alit commentedPatch #4 works good. Thank you Agileware!
Comment #24
KarenS CreditAttribution: KarenS commentedSo if we added a feature like this it adds complexity to the code. Almost certainly it will break something for someone, these things always do. And then you get used to having it, but as soon as you upgrade to Drupal 7 you will no longer have this feature because core does not support it.
It is very late in the release cycle for the D6 version. Basically we are not adding anything to this version that won't work in D7 because it makes no sense to give people a new feature that will later disappear again. And we need to minimize changes for the thousands and thousands of sites that are already set up around the current feature set. And we just don't have time to fix bugs in D6 and work on D7 port/migration issues and also add and support new features in D6.
So this is unlikely to get in.
Comment #25
Agileware CreditAttribution: Agileware commented@KarenS
If this will not make it into D6, then why not bump it up to be included in D7? Better than losing the ideas, feature and the community work altogether.
Comment #26
KarenS CreditAttribution: KarenS commentedYou want to make this a core feature issue for D8 (too late for D7)? Go ahead if you like.
Comment #27
mattiasj CreditAttribution: mattiasj commentedsubscribing
Comment #28
3dloco CreditAttribution: 3dloco commented+1
[edit-update] Thanks a whole lot for this patch, I really hope it gets into cck 6.x-3.x-dev! This is working for me really well...using it with cck 6.x-3.x-dev as of 2010-Dec-24
Comment #29
Andrew Gorokhovets CreditAttribution: Andrew Gorokhovets commented+1
Comment #30
SeanA CreditAttribution: SeanA commented"Drupal 7 you will no longer have this feature because core does not support it."
Then D7 is broken. When I first starting using multiple CCK fields, it was obvious the correct way to implement it would be to do what this patch does. It is absolutely imperative that we be able to control 1) how many fields are displayed initially and 2) how many are added when 'add more' is clicked. The borked way multiple fields was implemented in the first place is the problem. And now this is being kicked down the road to D8? Amazing! With the way multiple fields currently works, this should be considered a bug, not a feature request.
Comment #31
interestingaftermath CreditAttribution: interestingaftermath commentedSeanA, I couldn't agree more. When I first found multigroup I was amazed that it couldn't do this already as it seemed quite necessary. After searching everywhere I found no one else talking about it so I contracted Agileware to build it. They did a great job and I'd love to see it added to multigroup core!
Comment #32
Junro CreditAttribution: Junro commented+1
Comment #33
interestingaftermath CreditAttribution: interestingaftermath commentedHas anyone using this module upgraded to the latest dev version? Curious to see if it still works or if I should hang back.
Comment #34
Fidelix CreditAttribution: Fidelix commentedsubscribing...
Comment #35
rogueturnip CreditAttribution: rogueturnip commentedsubscribe
Comment #36
3dloco CreditAttribution: 3dloco commentedI have been testing it with cck 6.x-3.x-dev as of 2010-Dec-24 and it looks like when one is sharing fields across content types there are a couple of things that start happening:
1. For an imagefield that is shared across content types the settings get applied to all content types, like a global setting. This imagefield is not inside a multigroup.
2. For a filefield inside a Multigroup that is shared across content types the settings only get applied to the content type where the field was first created. The other content types with the filefield don't even get the settings to select the number of slots to open.
3. When one is saving the node, there is a validation error if there are slots are that are left empty or not used, so the user must close all the slots that they did not use.
For #1 & 2, I'd like to know if the patch covered/was intended for shared fields but it would be very useful if each field could have its own setting even if it is shared across content types.
For #3 Any pointer on how to avoid this validation for empty slots..?
Thanks,
KH
Comment #37
picxelplay CreditAttribution: picxelplay commentedsubscribing
Comment #38
Shadlington CreditAttribution: Shadlington commentedWill it be possible for this to get into D7 via contrib?
Comment #39
KarenS CreditAttribution: KarenS commentedAs I noted in #24, this adds complexity to an already complex module. It alters the schema, which in turn affects the Content Migrate code for D6 to D7 upgrades. It also makes *this* module more complex, and it is already hugely time-consuming to debug all the permutations of the ways that field settings and group settings work together. I just spent two or three days trying to figure out the best way to make sure that required fields are only required in groups that are either not empty or required. It exhausts me to think about going back to re-visit all that code after adding in a huge patch like this to make sure things still work correctly.
Multigroup is a bit of a hack to work around some limitations in the way fields and forms work in D6. This problem can be solved much more elegantly in D7, so the upgrade path will be to migrate data from this module to some D7 successor (most likely Field Collections), not to use the same hacky solution in D7. The goal for D6 is to provide as much functionality as we can easily and realistically support. For the most part, it is feature-frozen, because adding new features will require extensive testing and debugging.
So this feature isn't likely to get in.
Comment #40
Shadlington CreditAttribution: Shadlington commentedI'd like this feature in D7 - not specific to any multigroup-like implementation, but to all field types - i.e. I would like to be able to have a standard unlimited-value text field initially display with 5 items in the edit screen, as I know that for 90% of the time there will be around 5 items entered for this field and I'd like to save my users the time of clicking the button 4 times.
Should I raise a separate feature request for this?
Comment #41
Alphabool CreditAttribution: Alphabool commentedThe patch in #4 appears to be broken for 6.x-3.x-dev as of 2011-Mar-17.
I have adapted the patch to the most recent 6.x-3.x-dev release as of this writing, which is 2011-Mar-17. This patch does not reflect the issues in #36.
This was my first time rolling a patch so even though it seemed to come out okay I suggest applying with caution! :P
That said, I need to do more testing before I can say this works as expected but it doesn't seem to break anything significant, at least.
Comment #42
ulrikls CreditAttribution: ulrikls commentedThe patch in #41 seems broken in 6.x-3.0-alpha3. The attached screenshot show a multigroup containing a plain text field. Initially it shows four rows, and a click on "Add more" should add two rows. However it adds only one (partly) functional row and a yellow (dead) row. Another click will remove the first added row and add two more rows.
Any ideas on how to get this working? It would be really nice to have the ability to add e.g. ten more rows on a click on "Add more", even if there will be no upgrade path to Drupal 7.
Comment #43
Fidelix CreditAttribution: Fidelix commentedIs it possible to achieve this in contrib for D7?
Comment #44
heresh CreditAttribution: heresh commentedHi to all
Is there any workaround for D7?
Comment #45
Shadlington CreditAttribution: Shadlington commentedYou don't need to rename issues just to post a comment.
Comment #46
Junro CreditAttribution: Junro commentedPatches are broken since a long time ago.
Everybody using this fonctionnality are still using a version of cck from July 16, 2010 (Date of Agileware patch at comment #4) ?
Is there someone who knows what to do about the patch in order to use the last dev version of cck ?
It will be very usefull and will avoid a lost of time to those using last dev version or alpha 3 of cck et would have this functionality...
Thanks :)
ps: For me, using Patch #41 results to the same bug in #42.
Comment #47
Junro CreditAttribution: Junro commentedHere some informations:
Running the patch (I did it manually to be sure...) makes the Initial number of repeats work but not the Number of repeats per click.
When I click I have bug in #42 (see png image).
When I run update.php after installing the patch, I have :
The following queries were executed
content module
Update #6011
I hope it will help to find what's wrong with the patch :)
Comment #48
SeanA CreditAttribution: SeanA commentedHi Junro, I need this for a current project so I'll work on it soon. Very disappointing that we'll be stuck on D6 just to have this basic functionality.
Comment #49
Junro CreditAttribution: Junro commentedHi SeanA, very disappointing, indeed... :(
Comment #50
3dloco CreditAttribution: 3dloco commentedThanks @Alphabool for your patch...
@SeanA
I understand your pain...as I am also stuck in D6 for this and other functionality...I was wondering if you were able to fix it or track the issue for your project?
Thanks,
KH
Comment #51
semanthis CreditAttribution: semanthis commentedJust for the records, http://drupal.org/project/multivalue_settings kind of solves that problem for most cases (unluckyly not form my case...).