I'm not sure if this should be a support request, bug report, or perhaps a feature request to views, so my apologies if this ultimately is not related to how multigroup is functioning. I am trying to create a multi-tiered office hours field that can group opening and closing times based on one field: branch. I'm really close, but the branches duplicate the hours listed for the other branches. Am I missing something, or is this just not possible with multigroups and views at this point? You can see the attached edit form (and see the desired results based on what is entered into the form). Then the attached screen of the results shows the problem duplicates. Any suggestions?
| Comment | File | Size | Author |
|---|---|---|---|
| branch_view.jpg | 36.38 KB | bomarmonk | |
| branch_hours_edit.jpg | 46.6 KB | bomarmonk |
Comments
Comment #1
bomarmonk commentedAnd a copy of my table view based on the multigroup (thanks for any help):
Comment #2
markus_petrux commentedThe multigroup module exposes a filter to Views that should allow you to sync the delta values of the fields in the multigroup. Have you tried that?
Comment #3
bomarmonk commentedDoes this mean that the fields for my view should include the "delta" designation? My apologies for not understanding the possible configuration options.
Comment #4
markus_petrux commentedWell, each field on a multigroup is stored on a separate table. The primary keys for these tables include vid of the node and delta for each field value. That's what generates duplicate records, and that's what the Multigroup exposed filter tries to address by adding conditions for delta keys to the joins on these tables.
Related issue: #416154: Synchronized deltas Views integration: Filter on equal deltas in multigroups
Try it and see if that solves your issue.
Comment #5
bomarmonk commentedAny further tips on how to set this up? I tried adding just the grouping field with the delta and this had some rather duplicating results. Do I use deltas on every field? I'm just not sure. Thank you for any pointers. I'll be glad to report back if it works.
Comment #6
hellomobe commented@bomarmonk : Under filter you should have an option for 'content multigroup' -- if you don't see it, try updating your cck to the latest version. Then you should see an option listing your multigroup pairings. It will ask you what field to sync with (choose the one that will always have data - a required field). If you only have one set of multigroups, you should be set.
However, if you have more than one multigroup....(help please)
I have two multigroups sets in one view query. The filters work to group the sets (A set and B set), but they duplicate as follows:
Title ABC
A1 - Delta 0
A2 - Delta 0
B1 - Delta0
B2 - Delta 0
Title ABC
A1 - Delta 0
A2 - Delta 0
B1 - Delta1
B2 - Delta1
Title ABC
A1 - Delta1
A2 - Delta1
B1- Delta 0
B1 - Delta 0
Title ABC
A1- Delta1
A1 - Delta1
B1 - Delta 1
B2 - Delta 1
I'm not sure how to combine them all under one Title ABC. I tried the php custom field using this code but it work...it's not in a node tpl is one issue why. I tried the print_r($data), but I'm not knowledgeable enough to combine all the fields for each set.
print $node->content['group_car_info']['group']['#children'];Comment #7
hellomobe commentedOkay, I discovered the fieldgroup_view_group() function. Is the nodetype suppose to be the name of the content type? If not, what should it be. Here's what I have, but I get the following error and no results. I did some research and unfortunately can't find an explanation/fix for the error.
warning: __clone method called on non-object in C:\xampp\htdocs\drupal\includes\common.inc on line 1722.
Comment #8
hellomobe commented@bomarmonk
Reading your comments more thoroughly, and getting more familiar with my own problem, I think you may have the same need as I did. Sorry for the repeat in #6.
Take a look at this comment http://drupal.org/node/692186#comment-2563668. You can group the multiple values of the multigroup using one of the fields as the sync key value. Notice that the title is the field that syncs with the key, and then you can pull any of the other fields in that group -- in that example it was the url for the title link.
It worked wonderfully for me. Don't use the content-multigroup filter with this solution. Let me know if you have questions in configuring it to your set up and I'll try to help. (I'm not a programmer).
Comment #9
rbrownell@bonarmonk
Did you ever get this resolved? I find myself with the exact same issue when it comes to what I am developing. I found hellomobe's solution difficult to understand. (I am not an expert at PHP but I can decypher patterns and either the one suggested by hellomobe is erroneus or I am just not getting it.
I am looking for something that will print:
Date 1
Label1: Price1
Label2: Price2
Date2
Label1: Price1
Label2: Price2
Where as Label and Price are variables that belong to one another and I can have them print one next to the other. In a sense, I almost want a View inside of a view because at some point I am going to want to shove the values into a PayPal button and print these paypal buttons individually. (Uber Cart and others just don't do what I need it to do.)
Any Thoughts? Anyone?
Comment #10
rbrownellResolved...
it can be achieved with the content multi-group filter and then group by date.
-R
Comment #11
bomarmonk commentedWill this filter also work with other fields, such as a "branch?"
So I have office hours listed on a node that represent a department, let's say it's the node that represents the Sheriff Department, and I want to list office hours for two locations or offices where the sheriff deputies take complaints from the public. This might look like:
Sheriff Node
M-W 8:00 a.m. - 5:00 p.m.
Th-F 10:00 a.m.- 1:00 p.m.
M-F 9:00 a.m. - 3:00 p.m.
I'm going to try filtering on the location field and see if it now works. Previously, this did not work.
Comment #12
rbrownell#11 This is terribly finicky, as I don't think views is yet properly designed to handle such things. (Lots of development will be required on this in the future.) Just keep messing with it and it should eventually work out the way you wanted to. (It took me a whole afternoon of messing around with it to try to get it what I wanted to do.
EDIT: Make sure you use the Backup and Migrate Module frequently when working with this. At least three times I found myself having to rebuild the view because it got messed up and I couldn't find where the error was after reversing all the changes I made it still wouldn't work. BACKUP BACKUP BACKUP BACKUP!
-R
Comment #13
hongpong commented* subscribing
Comment #15
bomarmonk commentedI think this still needs some documentation/instruction; I've spent some time playing with the multigroup filter and field deltas, etc., but have not achieved the desired result.
Comment #16
bomarmonk commentedYes, I managed to make this work! Hurray! I'll see if I can't add some instructions on how I achieved this.
Comment #17
bomarmonk commentedHere is an export of my view; I hope it helps:
Comment #18
karens commentedThere is no patch to review and this is a support request. I think the proper response is that the views filter needs some better documentation. An export of a view is nice but it uses a bunch of fields and groups that won't exist on anyone else's site, so there is no way to import it.
Marking this fixed because the original support request was answered.
Comment #19
bomarmonk commentedYou are right, Karen: it would be better if I really documented how this grouping can be accomplished in a view. I'll try to add more explanation at some point that someone can adapt for formal documentation.