Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
This is a carryover of http://drupal.org/node/399886#comment-1809212.
Comment | File | Size | Author |
---|---|---|---|
#40 | flexifield-fields-within-fields.patch | 3.41 KB | zarexogre |
#16 | flexifield-widget.inc2_.diff | 827 bytes | mpaler |
#16 | flexifield-cck-overrides.inc2_.diff | 927 bytes | mpaler |
Comments
Comment #1
effulgentsia CreditAttribution: effulgentsia commentedChanged title.
Comment #2
Nigel CunninghamSubscribing. I have the same issue and am willing to test patches.
Comment #3
nicholas.alipaz CreditAttribution: nicholas.alipaz commentedFrom what I can tell the POST url seems to be incorrect:
Without a fieldset the url looks like:
With a fieldset the url is:
Notice the %3A, that looks to be the issue, but I could certainly be wrong. Let me know if there is anyway I can help. I was able to find a bunch of info under firebug's "XHR -> Net" tab.
Comment #4
nicholas.alipaz CreditAttribution: nicholas.alipaz commentedAny updates on this bug? it has been a while.
Comment #5
abaddon CreditAttribution: abaddon commentedim setting this as needs review to get some advice from the maintainers on the below
the above %3A is not a typo
the url gets set in file flexifield/flexifield-widget.inc , line 92 , function _flexifield_alter_multiple_values_form_process()
the processing flow goes to flexifield_ahah_addmore() , line 243
there the argument above is expanded to an array again, and the field itself is removed, leaving only its parents, if any, in the array
the next part im blurry about, if there arent any "parents" the code works as expected, but the processing flow goes to another function as seen below
if there are parents (like a fieldgroup), the processing flow continues below this code, and it fails to "add another item" to an unlimited items field, it just refreshes the field
to fix it, im sabotaging the "if" above, making it run regardless, something like this (or remove it altogether):
im pretty sure im breaking something with this, but its probably not something that im using(?!)
to all : please let me know if this works as expected for you as well?
to maintainer : do you know what is the logic of the code below this "if" and any advice to fix this better?
,thanks
Comment #6
crea CreditAttribution: crea commentedThis is critical.
Comment #7
effulgentsia CreditAttribution: effulgentsia commentedApologies for being remiss in maintaining my issue queue. See project page for more info about that. However, I did make a commit to dev which I think fixes this, but don't have time today to test it properly. Can one of you please test it for me? Thanks!
Comment #8
bmddddd CreditAttribution: bmddddd commentedsubscribe
Comment #9
keva CreditAttribution: keva commentedHaving the same problem with a flexifield within a flexifield.
Flexifield 6.x-1.x-dev results in the same errors as flexifield-6.x-1.0-alpha5.
Tested 6.x-1.x-dev using dru6.14 and both CCK2.4 and CCK3.x-dev
basic setup:
Parent node
- flexifield 1
- text fields
- flexifield 2
- text fields
Adding another flexifield 1 works fine
Adding another flexifield 2 produces these errors:
cck 6.x-2.4 on localhost:
The page at http://localhost says:An HTTP error 500 occurred.
/classtest2/flexifield/ahah/addmore/addmore/class/field_classlisting%3A0%3Avalue%3Afield_classtimes/field_classlisting%3A0%3Avalue%3Afield_classtimes
cck 3.x-dev on dev server:
The page at http://... says:An error occurred.
/~classtest3/flexifield/ahah/addmore/addmore/class/field_classlisting%3A0%3Avalue%3Afield_classtimes/field_classlisting%3A0%3Avalue%3Afield_classtimes
Fatal error: Maximum execution time of 30 seconds exceeded in /home/classtest3/public_html/sites/all/modules/flexifield/flexifield-widget.inc on line 244
Warning: MySQL server has gone away (etc)
Comment #10
bmddddd CreditAttribution: bmddddd commentedI got something!
There are wrong parameters passed to the function.
function flexifield_ahah_addmore($sTypeNameUrl, $sFieldName, $sParents, $sDataParents)
Inside a group, $sTypeNameUrl is "addMore" but it should be the content type which holds the fields.
Also $sFieldName is wrong, it holds the actual content type which should be in $sTypeNameUrl, but should be the name of the field you whant to add.
Since I just use it in one place I did a conditional stetement testing the "addMore"-Value and fixing it to the right values ... tada! worked for me... but is quiet dirty since I don't know where the parameters originally come from...
Comment #11
penguin25 CreditAttribution: penguin25 commentedSince nobody has repsonded to post #5, I thought I'd say that the suggestion in that post has fixed this problem for me. Presumably the area that the suggested workaround breaks would be nested flexifields inside other flexifields? I don't have any of those in my site to test, unfortunately.
Comment #12
abaddon CreditAttribution: abaddon commentedyou guys should check and answer to comment #7 from the module maintainer, do this versus my comment at #5 - i cant spare the time for this right now, and i didnt use the -dev release
Comment #13
effulgentsia CreditAttribution: effulgentsia commentedHi all, in case anyone here hasn't read my status update on the project page, I wanted to say that I apologize for not having maintained this module well for the past couple months. I've been busy helping out on Drupal 7 core development. The code freeze for that was originally scheduled for 10/15, then extended to 10/19, we hit a snag on a couple important issues, and are now waiting for Dries to announce what is to happen to them. I'm pleased with what everyone has been able to accomplish with Drupal 7 prior to the freeze, and with my small contributions to it. I will be resuming maintenance on flexifield within the next couple days. Thank you for your patience.
Comment #14
Nigel CunninghamSorry for not replying - I haven't been watching the status of my issues. I'll try it out as soon as I can find some time.
Comment #15
mpaler CreditAttribution: mpaler commentedWork around in #5 doesn't work for me. Only allows one additional row to be added.
My flexifield is simply two textfields.
This flexifield is wrapped in a field group in a parent form.
Comment #16
mpaler CreditAttribution: mpaler commentedThe fix in #5 is partially right.
The check around line 252 in flexifield-widget.inc should be removed:
However, the problem I was having is that I was moving my flexifield into a system defined cck fieldgroup (in this case ubercarts product fieldgroup) using hook_form_alter and my widget was still failing.
The problem was in flexifield-cck-overrides.inc around line 215:
Which looks to see if your flexifield is wrapped with a field group in the parent cck settings. In my case this fails.
I think a more extendable solution is to pass the fieldgroup name at runtime to
flexifield_add_more_js($sTypeNameUrl, $sFieldName);
My patches are attached (I forget how to do multi-file patches). The files need further cleaning up because with these patches there will be some useless code in there....but I'd like to get some feedback before I do any more...
This code is tested with a flexifield wrapped in a field group in it's own cck definition, as well as when the flexifield is in fieldgroup in another cck type.
Mike
Comment #17
ssm2017 Binder CreditAttribution: ssm2017 Binder commentedusing the patch in #15 :
i can add a new item but only one item
if pushing again the button to add another new item, the progress is turning, then, nothing appears
i need to save the node to add a new item again
Comment #18
benone CreditAttribution: benone commentedsubscribe
Comment #19
mrlava CreditAttribution: mrlava commentedsame problem =/
Comment #20
HnLn CreditAttribution: HnLn commentedsubscribe
Comment #21
yogesh1110 CreditAttribution: yogesh1110 commentedHi Mike
Thanks for sharing your code here. It's works for me perfectly.
Comment #22
DavideOrazio CreditAttribution: DavideOrazio commentedSubscribe.
Comment #23
isopharius CreditAttribution: isopharius commentedpatch #16 works for me thanks
Comment #24
Nigel CunninghamPatches in comment 16 work for me too.
Comment #25
blecheimer CreditAttribution: blecheimer commented#16 worked for me too. Thanks!
Comment #26
friedenz CreditAttribution: friedenz commentedHello. For me the patch in #16 solve that problem but now. Mi fieldgroup collapse over and over after I add another item. Someone could help me.
Comment #27
effulgentsia CreditAttribution: effulgentsia commentedThanks for all the testing, everyone! I committed an alternate solution than #16, but #16 was very helpful in figuring out the problem. The committed solution solves #26 too.
Comment #28
friedenz CreditAttribution: friedenz commentedHello effulgentsia. It still doesn't work for me. Could you help me. Please see http://www.estoydesempleado.com/node/add/curriculum and then in "Experiencia Laboral".
Tank's
Comment #29
stefan81 CreditAttribution: stefan81 commentedhi, are this fixes applied to 6.x-1.x-dev?
Comment #30
barckhoff CreditAttribution: barckhoff commentedsubscribe
Comment #31
willhowlett CreditAttribution: willhowlett commentedSubscribing
Comment #34
rikvanderkemp CreditAttribution: rikvanderkemp commentedRe-opening this bug report. This is still an issue. Patches provided above do not solve this problem. Anyone fixed this already?
Comment #35
samccone CreditAttribution: samccone commentedI am having the same issue, the patch at 16 does not solve my problem,
the only time the issue occurs is when adding a new flexifield within a flexifield
this is the error message i get
An error occurred.
/flexifield/ahah/addmore/addmore/........
Comment #36
Isostar CreditAttribution: Isostar commentedI used the dev version, but see the same problem.
In the firebug console I see:
{ "status": true, "data": "\x3cdiv class=\"messages error\"\x3e\n \x3cul\x3e\n \x3cli\x3ewarning: Parameter 2 to date_form_alter() expected to be a reference, value given in /var/www/iff2/includes/common.inc on line 2883.\x3c/li\x3e\n \x3cli\x3ewarning: Parameter 2 to date_timezone_form_alter() expected to be a reference, value given in /var/www/iff2/includes/common.inc on line 2883.\x3c/li\x3e\n \x3cli\x3ewarning: Parameter 2 to domain_form_alter() expected to be a reference, value given in /var/www/iff2/includes/common.inc on line 2883.\x3c/li\x3e\n \x3cli\x3ewarning: Parameter 2 to peek_form_alter() expected to be a reference, value given in /var/www/iff2/includes/common.inc on line 2883.\x3c/li\x3e\n \x3cli\x3ewarning: Parameter 2 to wysiwyg_form_alter() expected to be a reference, value given in /var/www/iff2/includes/common.inc on line 2883.
...
It seems to be an incompatibility with php 5.3
I don't get those errors when I do 'add another item' with a 'normal' field
Comment #37
willhowlett CreditAttribution: willhowlett commentedI applied the patch at #16 to the alpha-5 version of the module and it seems to have fixed the problem, whereas the latest dev version gives me an error message ('An error occurred.
/flexifield/ahah/addmore...') when clicking 'Add another item'.
Comment #38
jjemmett CreditAttribution: jjemmett commentedIsostar, I am getting the same error as you, however this seems to be a separate case. And should be moved into it's own issue.
edit: Isostar, also make sure you don't have the theme developer module installed as it breaks flexifield.
Comment #39
ankitchauhan CreditAttribution: ankitchauhan commentedhi
I have applied both patch. It's working fine, but still have some problem with validate. my flexifield is required and i am using conditional field module.
Comment #40
zarexogre CreditAttribution: zarexogre commentedFor flexifields within flexifields I have a patch which works. Its just tweaks the urls to be correct.
Comment #41
r3z0nate CreditAttribution: r3z0nate commentedThank you! You saved me some time trying to fix the same issue. It did work as it was expected, and I was hoping it was the last hurdle but unfortunately I'm having a problem with another item.
I'm trying to create a form with a row of fields that can be added an unlimited number of items, with each row including a sub-row that can be added an unlimited number of times. Since the the sub-row has to be nested, the only way that I found it could be done was by creating 3 node types. I have the layout exactly how I need. There are no issues adding rows to either node type.
For some reason, it will not save a new node. If I create a new node from the 2nd or 3rd node type, the node is saved correctly.
Is it as simple as switching where the multigroup is? Is this even possible, or have I made it over complicated? I tried other methods, but either didn't have the rows nested or had the fields being saved incorrectly in the database.
Node 1
-Flexifield of Node2 (unlimited rows)
Node2
-Fields (limited to 1)
-Flexifield of Node 3 (unlimited rows)
Node 3
-Multigroup
--Fields (limited to 1)
Comment #42
Dret CreditAttribution: Dret commentedSame Issue for me,
I have a multivalue Flexifield nested inside another multivalue Flexifield... but the Add Button for the Inner one... is not working.
Thanks, bye!
Comment #43
SGhosh CreditAttribution: SGhosh commented#40 - zarrex
The patch's great. It solved the issue of multiple fields showing up by default.
I have a content type - which has a flexifield - this flexifield has a flexifield within it. The inner most flexifield has a date field.
Both flexifields are multiple valued.
The "Add another item" for the innermost flexifield(Task) was working but adding a maximum of 2 fields, trying to add more fields had no effect; commenting out
solved the issue.
Using the "Add another item" for the outer flexifield(Milestone) adds an extra Task to the previous Milestone if this previous Milestone has only a single Task.
I also have a date field in Task. When adding a new Milestone or Task the date fields values are all being removed and replaced by 2.
Cannout find the issue!! Please help.