Closed (fixed)
Project:
Content Construction Kit (CCK)
Version:
6.x-3.x-dev
Component:
content_multigroup.module
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
18 Mar 2011 at 14:32 UTC
Updated:
23 Nov 2011 at 19:24 UTC
Jump to comment: Most recent file
Comments
Comment #1
DeFr commentedAttached patch seems to fix the problem.
Comment #2
tomsm commentedApplied the patch, it also solved this issue: http://drupal.org/node/1096776
Comment #3
intyms commented@DeFr
Thank you. The patch works.
(I don't see any more the warnings when i create a new node or when i edit an old one.)
Comment #4
Ela commentedPatch in #1 works for me too
Comment #5
mariagwyn commented+1 for patch in #1
Comment #6
jvieille commentedpatch in #1 works
Comment #7
lanzs commentedThanks for patch! It works for me
Comment #8
realityloop commentedThis resolves the error, so marking RTBC.
Comment #9
giorgoskwarning gone after applying the patch
Comment #10
christiaan_ commented+1 for patch #1.
Thank you very much.
Comment #11
JKey commented+1
Thank you very much!
Comment #12
circuscowboy commentedI hope this patch gets committed. I solves the problem for me.
Comment #13
Baudouin commentedPatch works for me. Thanks.
Comment #14
pvanerk commentedPatch works for me. Thanks!
Comment #15
andreiashu commentedWorked for me too. Thanks!
Comment #16
slybud commented+1 for the patch, works for me too !
Comment #17
karlitos commentedThank you very much!!! worked for me too ;-)
Comment #18
Macronomicus commented+1 - Works as advertised.
Comment #19
samiu1287 commentedThanks for the patch! Beside the issues on this thread, when I clicked on 'Add more values' for a multigroup fieldtype, I would allways get a 500 error. After applying the patch, everything seems to work as designed. Thanks a lot and someone make sure this patch gets committed.
Comment #20
Morasta commentedMany thanks for the patch, did the trick for me.
Just in case anyone is unclear this is for multigroups without a required field. The rest of the form doesn't matter.
Comment #21
Thierry Roffini commented@DeFr
Thanks ;)
Comment #22
jvieille commentedCan this patch be committed? This issue shall be closed now
Comment #23
johnnybgoode commentedEdit: alternate patch to the one posted previously - addresses warnings by checking the array before array_keys is called, as opposed to always creating an empty array. First patch may be more efficient but I have not tested enough to determine if there are any side effects.
Comment #24
DeFr commented@#23: We've been running several major sites in production with the patch attached in #1 without any side effect pretty much since the release of CCK alpha3.
The only thing that the patch could broke would be a content type with different fieldgroups with the same name, which can't happen thanks to both the validator and the database structure (the primary key of the content_group table is (type_name, group_name)).
I'd would rather thus stay with the patch in #1, which has been RTBC for some time and is presumably already tested in the wild by all the commenters in this issue.
Comment #25
edwinyn commentedPatch #1 works flawlessly on single value. On unlimited values, when I click "Add more values" it says "An error occurred... Call to undefined function content_set_nested_elements() in <b>..\sites\all\modules\cck\modules\content_multigroup\content_multigroup.node_form.inc.."
Anyone?
Comment #26
DeFr commented@edwinyn, #25: content_set_nested_elements is defined in content.module, there's pretty much no way it can be undefined in the JS handler, and it works fine here. Did you only update some part of CCK somehow, like, only the content_multigroup submodule ?
Comment #27
edwinyn commented#26, you are right, I only update the content_multigroup submodule. Currently I am using cck 6.x-2.9 and just want to have a multigroup feature as I've got some error when upgrading cck 6.x-2.9 to 3.0. It says "User warning: Unknown column..." when I tried to re-arrange the fields (I have many fields). Still don't know how to upgrade it instantly.
Comment #28
jlashomb commentedThe problem is when $form['#multigroup_required_fields'][$group_name] is NULL and not an empty array when used in array_keys. Does it then make sense to just cast that value to an array when using it in the that function?
replace:
array_keys(
with:
array_keys((array)
Comment #29
DeFr commented@jlashomb, #28: Just use patch in #1, which ensures that $form['#multigroup_required_fields'][$group_name] is initialized to an empty array like it was intended to.
@edwinyn, #27: You can't just take part of CCK like that, the landing of Multigroup implied various tweaks to the underlining assumptions made in CCK data storage, which is why a 3.x branch was created. The only difference between CCK 2.x and CCK 3.x are related to multigroup and nested fieldgroup handling, so, in short, if you want to use multigroup, then you want CCK 3. You ran the updates listed in update.php after trying to upgrade to CCK 3 right ? If you did, and you still get a query error, then you should open a new issue.
Comment #30
andreiashu commentedJust wanted to add regarding #23: we've been using the patch from #1 for over 1 month now in a few productions sites and never had a problem so (as DeFr already did) I would also recommend to not change it unless someone finds a bug with it.
Comment #31
theatereleven commentedI'm receiving HUNK failure messages trying to apply this patch to Drupal 6.22. Any ideas?
Comment #32
giorgosk@theatereleven
so you are not succeeding at patch applying
make sure you read the patch section (http://drupal.org/patch)
and you have the right tool to apply the patch
Comment #33
theatereleven commentedI tried it again and it said:
Hunk #1 succeeded at 122 with fuzz 1
Not sure what that means, but the patch seemed to have worked as I'm not getting the CCK errors any more.
Comment #34
3rdLOF commentedAnyone knows when this patch will be rolled into HEAD or a new dev version?
Comment #35
yngens commentedsubscribe
Comment #36
chey commentedPatch #23 worked for me. I was receiving errors on lines 316 and 281 and this patch fixed the issue.
Comment #37
DeFr commentedPosting it once again to avoid confusion: the patch that has been RTBC is the one in #1, not the one in #23. All it's waiting for is feedback and hopefully commit from a CCK maintainer.
Comment #38
sarhansg commentedEDIT: I managed to run the patch. However, now when I create multiple entries within a group the content does not get saved. Anyone else experience this?
Comment #39
DeFr commented@sarhansg in #38: More informations on how to reproduce your problem will be needed, because I'm pretty sure someone would have mentioned it by now if they had stumbled upon it. So, is your group a multigroup ? If yes, what are the types of the fields stored in it and how are you creating multiple entries, using the Add more button ? If not, I guess it's only creating multiple entries for a single field that happens to be in a group, so, what's the type of your field, is it nested in a sub-group and does it work if you move it out of the group ?
(I've just played a bit with creating a node with both an unlimited multigroup containing a node reference and a content taxomy field on the one hand, and a simple group with a single nodereference on the other, putting three values in each values in each fields using the Add more button, and the node came out fine here)
Comment #40
sarhansg commentedHi DeFr,
I'm guessing it's an error on my part since no other user reported similar issues. I'm no developer so please bear with me.
I created a multigroup field (Details). This field contains two sub-fields. The first is Date which uses the Date CCK field type and the other is Amount which uses the Money CCK field type.
Details field is set to "required" and "unlimited" whereas the sub-fields are set to "not required" (unchecked) and "1".
There's only one "add another item" shown within the fieldset.
Hope this helps. Let me know if you require any additional information.
Comment #41
DeFr commented@sarhansg in #40 : Huum, I've just tried to setup a new instance to try to replicate your problem, but it seems to be working fine here. Attached is an export of the Page content type with your multigroup added. What are you filling in the different fields, and what do you mean exactly by "the content does not get saved" ? Do you get the node form back, with a validation error, in which case that might be linked to #1126930: Validate error for not mandatory field ? Or do you get to the node page view, but without the values you've added ?
Comment #42
sarhansg commentedWhat I meant by "the content does not get saved" is that the additional values (in the multigroup fieldset) do not appear in the node page value. Only the first value does. When I try editing the content again the additional values are no longer available. Hope this helps detect the problem.
Comment #43
ofktoubro commented#1 worked for me as well
Comment #44
yched commentedCommitted. Thanks !
Comment #45
DeFr commentedMoving to fixed accordingly.
@sarhansg: If you still have an issue with your content type, I think you should open a new issue. Ideally if you can, attach an export of your content type (you can get one with the Content Copy module that's bundled with CCK), which will make it easier to try and reproduce your problem.
Comment #47
emcniece commentedFor what it's worth, I'm still hitting this issue. 6.x-3.0-alpha3, packed on 2011-03-17. I just opened content_multigroup.node_form.inc and rolled down to line 122, and saw that this patch was already applied. Might have been me in the past, not totally sure, but the point is the error still shows up.
No further info!
Comment #48
DeFr commented@#47: The patch was commited in August, there's just no way for it to be in the alpha3 release packaged in March... (Commit )
Given the amount of people reporting that the patch fixed the issue for them, and the fact that we've been running in production with this patch for 9+ month, I'm rather sure that the patch fixes the warning. Either you didn't apply the patch correctly, (line 122 is only the start of the context, the line is actually added at line 125) or your running into a different issue. It should be pretty easy to check: the only commit in the 6.x-3.x branch since 6.x-3.0-alpha3 is the one for this issue, so you can download the 6.x-3.x-dev release and get just this fix.
Comment #49
chilic commentedThank you. The patch works.
Comment #50
emcniece commented@#48
I was running cck 2.9 :|
Thanks for your help.