Active
Project:
Content Construction Kit (CCK)
Version:
6.x-3.x-dev
Component:
content_multigroup.module
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
17 Jul 2009 at 15:35 UTC
Updated:
10 Nov 2012 at 20:21 UTC
Jump to comment: Most recent file
Comments
Comment #1
markus_petrux commentedI cannot reproduce this problem. It works here as expected. Tested several multigroups where a date field is combined with other fields as well.
I'm using latest development version of CCK3 + latest development version of Date module. Maybe the difference is there. Otherwise, it's hard to guess when it is not possible to reproduce the problem.
Comment #2
seehawk commentedI did some additional testing on this. I made sure I was on the latest dev versions of both Date and CCK. Still had the same problem.
I tested this on two separate installations of Drupal. One is a development site for a project I'm working on. The other is a stripped-down installation that only has the modules installed that I need to create the example.
Hopefully my terminology is correct. When I say that I created a new group, I mean that I clicked the "Add more values" button to get a new collection of fields. I have my groups arranged in a table format, if that makes a difference.
Anyway, I hope this helps. If I can think of any additional info that might be relevant to the bug, I'll post it here.
Thanks!
Comment #3
seehawk commentedforgot to reset the status with the new info...
Comment #4
markus_petrux commentedI see what you mean, but I'm unable to reproduce the problem here. As far as I can tell it works, so there may be something else...
Comment #5
seehawk commentedEureka!
The problem only happens when the multigroup is viewed as a multiple column table!
To see what I'm talking about, edit the content type, click on Display Fields, and set [Subgroup Format] to "Table - Multiple Columns". Other formats appear to be okay.
Comment #6
markus_petrux commentedI also tested this with multiple columns table in the form, and it worked here.
We need more information on how to reproduce this.
Comment #7
seehawk commentedHi Markus,
Just to get a clean test, I created another brand-new install. Here's what I did, step-by-step:
1) Set up a fresh install of Drupal 6.13 on localhost on a Windows NT machine using Wampserver
2) Created \sites\all\modules folder, added CCK 6.x-3.x-dev, dated July 22, 2009
3) Enabled Content, Content Multigroup, Fieldgroup, Text modules
4) Downloaded Date 6.x-2.2 and enabled Date, Date API, Date Popup and Date Timezone
5) Created a new content type called Test Type, and a multigroup within that type called Test Group, using default settings.
6) Added a text field and a date field (with the date popup widget) to the multigroup (using default settings in both cases)
7) Created a content item with two entries in the multigroup
** At this point, everything is working as expected. But...
8) Edited the content item, and clicked Add More Values at the bottom of the multigroup. Then I saved the node, leaving that third item in the group blank.
9) Upon viewing the node, the date has jumped down to a third item in the multigroup. The second item has no date. If I edit the node again, the date has disappeared from the second item, and a third item does not appear.
That's everything. I have no other modules installed on this test installation, and I'm not sure what else I can do from a testing perspective to isolate the problem. If you can think of something, I'll try it. In this case, I wasn't using a table display, so you can probably disregard my last comment about the table being the issue. In this case, I just used defaults.
Thanks!
Comment #8
markus_petrux commentedNow that I think of it, we're using fields of type "Datestamp". Not of type "Date". Maybe that makes a difference?
Comment #9
seehawk commentedProbably. I'm using date fields with the Date module.
Comment #10
seehawk commentedMarking this active again, since the issue persists with Date. If I have an opportunity to test with Datestamp, I will.
Comment #11
markus_petrux commentedFYI: We were able to replicate this issue here at the office, so I can now try to debug, etc... :)
Comment #12
seehawk commentedYay! I'm not insane!
(well, ok...maybe a little.) :-)
Comment #13
markus_petrux commentedWell, I think I've been able to track down the problem. When a date field is left empty, it is the #element_validate handlers in date that alters the values of the fields in the form state to NULL, and when it does, the weight of the item in the multigroup is lost. This causes the code in CCK/Multigroups that sorts fields by weight to move those with no weight upper than those that have a weight greater than 0.
Now I need to find a way to keep track of the weight regardless of the things that #element_validate handlers do on their widget elements.
Work in progress...
Comment #14
markus_petrux commentedOk, here's a patch that should fix this.
I'm added an element validate callback to all fields in a multigroup. This callback is appended at the end of the list of other element validate callbacks. This way we can ensure the '_weight' and '_remove' attributes of the element have not been removed by element validate callback of the widgets.
It should solve the problem with dates as well as any other widget that behaves in the same way with element validation callbacks.
Comment #15
edemus commentedThanks markus, works perfectly
the other thread bout date issue might be closed i believe #401326: Support empty values and multigroup
Comment #16
markus_petrux commentedOh, now I realize that I missed this problem for more than I thought. Well, I just marked that issue in Date module queue as fixed. We needed to find a way to solve this within the context of multigroup.
If someone else can confirm this works, I think we can commit this to CVS. :)
@edemus: Thanks for the feedback.
Comment #17
markus_petrux commentedCommitted the patch in #14 to CVS.
@seehawk: Thanks for your perseverance.
@edemus: Thanks for testing. Much appreciated.
Comment #18
seehawk commentedThank you, markus! Multigroup solves a big issue for me, and I appreciate all your hard work on this!
Comment #20
sdsheridanIronically, I'm experiencing this issue now, but the only difference is I have two date fields in the multigroup, one completely filled in for each delta, and the other with only the first filled in. However, once the node is saved, the delta in the database reads 2. Sorry to re-open, but not sure what's going on. I have the above patch in the version of CCK I'm using.
What else can I tell you?
Thanks for any help, Shawn
Comment #21
sdsheridanGot to love NetBeans. After a few hours of code walk-though, I found the problem. It's actually something in the date module, but surfaces in multigroups. I created a new issue at http://drupal.org/node/1837402 for this.
Shawn