Closed (outdated)
Project:
Webform Add More
Version:
6.x-1.03
Component:
Documentation
Priority:
Normal
Category:
Bug report
Assigned:
Reporter:
Created:
24 Jan 2012 at 00:09 UTC
Updated:
17 Jun 2016 at 13:04 UTC
Jump to comment: Most recent
Comments
Comment #1
john.money commentedNeed some more information here:
Comment #2
dgautsch commentedHi John, thanks for your help. here's my setup:
I'm using firefox and chrome on the latest release of drupal and I've confirmed the JS is in the header fields.
I didn't notice this before (error reporting was turned off) but I'm also getting the following error
Notice: Undefined index: label in webform_addmore_form_alter() (line 93 of ~/sites/all/modules/webform_addmore/webform_addmore.module).
Below is my form outline
Details (Fieldset with add more option enabled)
---Text Field
---Text Field
Options (Fieldset with add more option enabled)
---option 1
---option 2
---option 3
I have a feeling I haven't laid the form out the correct way.
Comment #3
Posthume commentedHi,
I'm also getting this error :
Notice: Undefined index: label in webform_addmore_form_webform_configure_form_alter()
Comment #4
lsolesen commentedI think an explanation why and how you need to edit two or more fieldsets.
Say I create a form, where I want Add more button to participant info.
Fieldset: Order information
- Order number
- E-mail
Fieldset: Participant info
- Name
- Date of birth
-- Enabled Add more...
So that is two fieldsets, but the button does still not appear. Should the participant info be duplicated, should it be inclosed in another fieldset? I tried most combinations?
Comment #5
sylv3st3r commentedDid some research,
So this kind of problem will appear if you have a 'space' on your form key name. Example, you named your fieldset "Participant Info" it will have "participant_info" key name, but Webform module/ Drupal will render the form key to "participant-info", notice it replace the underscore "_" with dash "-"
So try to change this:
into
On webform_addmore.module line 85.
Also there's a lot of bug here actually, for instance, if you use webform module "clone" feature, it will not have "cid" on line 37 :
$settings[$component['cid']] = $component['display']['addmore'];Hope that fix the button not appearing.
-r
Comment #6
john.money commentedsylv3st3r is correct. The bug some are encountering related to rendering the fieldset name. I should be able to code around this, but in the interim, please test with single word fieldset keys (e.g. participant-info or participant1).
Putting the other issue with cloning fieldsets on bug to do list.
Comment #7
lsolesen commentedActually I did it in Danish so there is no space in my form name (and hence not in the key name).
Comment #8
vmkazakoff commentedI have the same problem.
Try to use 1 word-long name for fieldset, but when I checking the "Add More fieldset" checkbox and save changes, it is not saved :(
If I open edit/components/.. page I dont have the checkbox checked
Where my mistake?
And one another time I ask about @two or more@ - what the structure is? Do thay need to be in one webform? I can put it together, or I need put one of it as child of enother? And why?
and one more: THANKS YOU for the grate module! It help me very much!!!
Comment #9
visualnotion commentedIt isn't appearing for me, either, but I'm using Drupal 6. I've tried using one-word fieldset names, etc. It's still not working. Any ideas?
Comment #10
lsolesen commentedI flushed the cache a couple of times, and now the button appeared. From the description I misunderstood the concept, as it seems that you need to create two identical fieldsets if you want the addmore button. I the module can only hide the second fieldset and show it. It cannot add more fieldsets dynamically.
Comment #11
Anonymous (not verified) commentedI made the changes proposed sylv3st3r in #5, but the button is still not visible.
It seems the reason is undefined variable "fieldsets" on line "
var hiddenFieldsets = fieldsets.not(':visible');" in "webform_addmore.js" it will be defined later.Fix:
p.s.
Sorry for bad English.
Comment #12
matthew.woodard commentedAny reason the webform_addmore.js wouldn't be showing up?
- I have the module enabled
- There are 2 fieldset (both with "Add More" option checked)
Ran Cron / Flushed Cash ... any ideas?
Comment #13
matt bUsing a single word fieldset key as per #6 worked around this for me, even with cloned fieldsets.
Comment #14
BMorse commentedI had it working by using the single word fieldset key but when I cloned one to add a 3rd fieldset it stopped working.
Comment #15
dubois commentedI received the error message in #2 when using single word fieldset field keys. However, these resolved with a cache-clear all.
Comment #16
cbrasfield commentedI was also getting the error
Notice: Undefined index: label in webform_addmore_form_webform_configure_form_alter()on line 94.I added an isset function to the ternary operation:
'label' => isset($settings['label']) ? t($settings['label']) : t('Add more'),Comment #17
cbrasfield commentedI was also experiencing the Undefined index:cid error when attempting to clone items.
I noticed in Webform, the cid was unset in cloning but never actually reset. So I modifed webform.components.inc as:
And in the webform_component_insert function at line 735, I changed
if (!isset($component['cid'])) {toif ($component['cid']=="") {Now it works without the cid index error. HOWEVER, there's no delete function associated with this module, so if you remove a field, you get an notice saying there's an offset error. I added the webform delete hook below the presave function as follows
This has not undergone extensive testing, but it seems to be working for me....at the moment.
Comment #18
strager-1 commentedHas this been fixed yet? I can't use this module until it is..... Spaces are mandatory for another module.....
Comment #19
otmoroz095 commentedYou're right!
I've changed my key "article_info" to "artinfo" and now i can see button! YYeaH! Thank you, (wo)man!
Comment #20
danny englanderI just ran into this issue as well / getting the same error message. I tested with a single word fieldset key but still no joy. (I also Made sure the
Add More fieldsetis checked, cleared cache and ran cron.)I am also confused, the version number for this issue was changed midway from 7.x to 6.x in #13, was that intentional? I am using Drupal 7.14 so in that case should I file a separate issue?
Comment #21
fdefeyter@gmail.com commentedHi there!
Thanks for developping this module. But I can't use it:
The JS is not loaded in the page. I added it from the html.php but it doesn't work. I will try via the .info file.
So of course, the button is not showing...
I really don't know how to resolve this...
I can see the usage statistics of this wonderfull module is falling to zero... Is that because of the version of the webform module compatibility?
Please help :-)
Thanks in advance...
Comment #22
fdefeyter@gmail.com commentedOK so finally I made it working. Sorry for my precedent post.
I first thought it was a loop: so that you could repeat the same fieldset as much as you wanted.
But it's not the case. You have to manually prepare all the fields you want.
So first, cerate a fieldset and select "addmore fieldset in the options".
Then add you fields like on a normal fieldset.
Create at least 2 like that.
Enjoy :-)
Thanks for coding to the author!
Comment #23
vinmassaro commentedWe ran into this bug and came across this thread. Having to know to change the machine names of the fieldsets is non-obvious.
Comment #24
pivwani commentedI spent hours trying to figure this out. After a lot of trials I managed to get this working as intended. I wanted to give a basic step by step to help save you some time.
Enable Webform addmore in modules
create content and choose webform.
Fill in all the normal stuff that you require
you can then add your specific fields, you will see 'new component name" faded. Add anything you like with spaces if ness
you must select fieldset in the type column and click 'add'
you will then see the field key enter a name for eg 'part1'. Do not use spaces unless you have altered the code as described above, it isnt really neccessary to have more than one work in the key, no one will see it. Its a machine name.
In the display box, and this is vital to get the button to appear. Only have selected 'hide label' and 'add more fieldset'. This is crucial.
Click save component
You can then add any option you like for eg 'Part number' The type can be anything you like or require
You then need to move this item under the fieldset you made previously and drag to the right, like parent & child in taxonomy etc.
Once you have done this, repeat it all again, create another field set, and also add the same option like 'part number'.
Remember the field keys need to be unique.
Once you have sorted out all of your options and layed it out, go back to edit each field set nd click back on, add more fieldset, check them all, for some reason when moving and altering fields and adding more it uncheck the field.
You should end up with something like this www.enginepartsuk.net/order-enquiry
I changed the .js file to in the webform addform module folder so it used my classes to make the button the same as the rest. This is isnt neccessary, but I think it looks better.
Sorry if this is a little basic for some users, this is my first post on the drupal forum. I have taken so much from these forums nd want to give something back.
Comment #25
Fujiedo commentedThanks a lot pivwani. This is it; no changing the code or .js. Works on Drupal 7 for me.
Comment #26
alok.tripathiThanks Pivwani. 'Add more' button is now working for me in drupal-6.
Comment #26.0
alok.tripathiSpelling fixes.
Comment #27
houstonaplus commentedMy issue is the javascript file is not showing up in the head section. The fieldset label is hidden and the "Add More" checkbox is active.
Comment #28
new123456789 commentedSo, I created two identical feildsets, the only difference is that the second set has a number 2 appended at the end of each field key (eg name2).
Hmmm. I seem to be unable to save the Add More fieldset option... Whenever I select the checkbox, select Save compontent... then go back in to check... the tick disapears????
Also, I keep getting this error every time, I try and close the form compontetns page:
To display this page, Firefox must send information that will repeat any action (such as a search of order confirmation) that was performed earlier.
I am running drupal 7 tho...
Comment #29
ssoulless commentedAny update in this? Im getting the same problems here
Comment #30
jorisx commentedNot Working at all with:
Drupal, 7.27
Webform, 7.x-3.20
Webform Add More, 7.x-1.2
...
All created fiedsets with 'add more' enabled' are just all shown, no buttons and nothing is hidden??!
Comment #31
ssoulless commentedthis is broken for drupal 7.29 and webform 4.x too
Comment #32
pivwani commentedSSouless
Please follow my instructions above. If not tell me what's happening.
Thanks
Works on all D7 inc 7.31
Comment #33
Pascal.s commentedAd the same problem!
#22 works for me. Maybe add more step in the README file would help a lot of people.
THANKS!
Comment #34
bellesmanieres commented