Comments

butler360’s picture

Subscribing

ManyNancy’s picture

Blah, :(

okeedoak’s picture

subscribing

picardo’s picture

subscribing

Flying Drupalist’s picture

Priority: Normal » Critical
swentel’s picture

Status: Active » Closed (works as designed)

Ok, this is simply not doable right now for a lot of reasons (techniqually in DS) and espcially with the state of the multigroup and cck 3 right now. We'll see what happens once we start with a 6--2 branch here and if CCK 3 ever gets an official release.

zeezhao’s picture

+1

drupalok’s picture

+1 any news on this issue?

drupalok’s picture

@wentel
could you outline in a few sentences why its not possible to use DS with multigroups? Do you think there will be a solution in the near future? Otherwise i think i might have to change to panels completely, though i love your DS module

vtsan’s picture

StatusFileSize
new12.41 KB

Hi,
I have created a patch for DS, ND, and ND_CCK to work with CCK 6.x-3.x-dev "Multigroup". I don't know if it is the right way do it or not. It seems to work for me. I hope someone will find this helpful.

swentel’s picture

Status: Closed (works as designed) » Needs review

Wow, I'll review this one this weekend, might be huge!

jstoller’s picture

+1

drupalok’s picture

i am too curious... does it work? will it be in the next dev?

jstoller’s picture

@swentel
Have you had a chance to review Vincent's patch in #10? Any chance it'll make it in?

jibize’s picture

would definitely be a nice addition!

vtsan’s picture

StatusFileSize
new12.91 KB

Jeremy pointed out that the drag and drop is not grouping. Here is the fix.

ManyNancy’s picture

Hi vtsan I applied the patch then moved the multigroup into the nd region. On the node display I see nothing though.

Clearing cache did not help.

Thanks.

vtsan’s picture

@ManyNancy
It is very difficult for me to troubleshoot your issue with a little details on the problem. However, to test if my patch is working or not. You could try to create a new node type and a couple of fields. Then you can create a multigroup field and move some of the fields into it. If you have ns, nd, and nd_cck module enable, on the nd move the multigroup into the region and the fields into multigroup. Hope this help.

jstoller’s picture

@ManyNancy
Just to reinforce what Vincent said, you not only need to move the multigroup into a region, but you also need to move the fields you want to display into the same region and place them within the multigroup (so they look indented in the list, under the multigroup). The group does nothing on its own.

ManyNancy’s picture

Thanks! That works.

I'm quite happy with this. One unexpected thing is that every multigroup itemrow is rendered as a fieldset. Is that correct behavior? Thanks.

vtsan’s picture

@ManyNancy
I am not quite understand your question. What should the item row be rending if not as fieldset?

ManyNancy’s picture

StatusFileSize
new12.92 KB

Sorry it's not the fieldset, it's that by default the div has the class fieldset in ds.module.

CCK uses the class 'field-item' for their items and this makes more sense to me.

Thanks again for the patch.

jun’s picture

Status: Needs review » Needs work

Hi vtsan,

Just tested your patch and it seems to work fine except for filefields.

What happens is :
1/ if the filefield is inserted at the beginning or in the middle of the multigroup then the only the first item of the multi group is displayed.
2/ if the filefield is inserted at the end of the multigroup then all items are displayed but changing formatters options doesn't do anything and the data seems corrupt (filefield appears once in a while while all item of the multigroup have a filefield value.

Hope this can help make this into DEV as this is a great addition to ND.

Best,

Jun

vtsan’s picture

StatusFileSize
new13.25 KB

Thanks! jun for testing it out. Here is the update patch. (Please disregard this patch)

vtsan’s picture

StatusFileSize
new13.25 KB

Sorry, I uploaded the wrong patch. This is the correct one.

swentel’s picture

Status: Needs work » Needs review
StatusFileSize
new10.88 KB

Ok, I've reviewed and tested the patch and .. not committed .. yet .. I can feel all your excitement hehe :)

Anyway, I've attached an updated patch with some changes for me to test at work tomorrow/monday because although I'm personally not interested in this feature, I'm willing to commit this as long it doesn't break default behavior (read without multigroup module enabled on a site) and it looks pretty good so far, but I need to be sure.

Changes in the patch

  • Removed some obsolete code
    1. case 'DS_FIELD_TYPE_MULTIGROUP' and 'DS_FIELD_TYPE_GROUP' in the ds_build_fields_and_regions() function- which was commented out anyway.
    2. theming function in nd_cck_theme() for the theme registry since the ds_get_cck_multigroup_content() function is used to get the content.
  • Code hardening in nd_cck: extra check if $items[1] is set.
  • Some coder guidelines (tabs vs spaces and all that stuff)
  • Use field-item instead of fieldset class (see #22)
  • +	        //$field_content = isset($vars[$key .'_rendered']) ? $vars[$key .'_rendered'] : '';
    +	        foreach($vars[$key] as $row){
    +	         $field_content .=  content_format($key, $row) . "<br>";
    +	        }
    

    I've removed the foreach and brought back the $field_content = ... because in my testing a field that is in a multigroup simply doesn't get in this else statement. If anyone can explain me why this is there, I'll bring it back and test it again. I don't see a use case however especially since it's using content_format again and the field here should really have '_rendered key already in the $variables.

3 remarks / questions

  1. I've noticed that once I put a field that is in a multigroup outside the multigroup, rendering really is broken. It only works when you render those fields within their multigroup, right ? If that's the behavior you can live with, me too :)
  2. Performance: ds_get_cck_multigroup_content() uses content_format() to render the output of the field in a multigroup. Fine (and good and safe), however, most likely, the multigroup module itself will do this too, thus this will run twice. We need to find out if we can remove the field from the $node object after we have formatted it so multigroup itself stops rendering. I'll have a look myself too when testing tomorrow.
  3. Note that multigroup module itself throws a few notices (label & description), not my fault and not anything that DS can fix.

To conclude: it looks pretty good so far, with a bit of luck I might commit this tomorrow already, fingers crossed folks!

swentel’s picture

StatusFileSize
new10.89 KB

Updated patch (just some tabs vs spaces changes)

jun’s picture

Excitement over here, I admit :)

More testing brought more suprises :
- Still changing the format of a filefield inside a multigroup doesn't work (seems like the first formatter is always the default one)
- Also some formatters (soundmanager2) bring up an error: Illegal offset type in isset or empty /var/aegir/###/includes/theme.inc
- When a filled field is followed by empty fields, the empty fields get the value of the first field.
- Empty multigroups (where all children fields are empty) are still displayed.
- Custom labels are not taken into account.

That's it for now, thanks to swentel and vtsan who are doing the actual work !

Jun.

jun’s picture

Status: Needs review » Needs work

One more thing : Ideally when selecting for instance "Fieldset Open" format, each subgroup from the multi-group should display in a distinct fieldset. Even better if the names chosen in the multigroup's subgroup labels where displayed as titles for each fieldset/tab/div.

vtsan’s picture

StatusFileSize
new13.6 KB

I fixed some of the format issue that jun has noticed. The main code fixed for this patch is follow.

       //Support for CCK-dev Multigroup
      if($fields['multigroup']){
        $group_content = ds_get_cck_multigroup_content($object, $group, $field_settings);
        foreach($fields as $key => $weight){
          unset($object->ds_fields[$key]);
        }
      }else{
	      foreach ($fields as $key => $weight) {
	        $field_content = '';
	        //$field_content = isset($vars[$key .'_rendered']) ? $vars[$key .'_rendered'] : '';
	        if(is_array($vars[$key])){
	          foreach($vars[$key] as $row){
		          $field_content .=  content_format($key, $row);
		        }		     
            if (!empty($field_content)) {
	            $object->ds_fields[$key]['type'] = 'ds';
	            $group_content .= theme($theme_function, $field_content, $object->ds_fields[$key]);
	            unset($object->ds_fields[$key]);	        
            }	  
	        }else{
            $field_content = isset($vars[$key .'_rendered']) ? $vars[$key .'_rendered'] : '';
            $group_content .= $field_content;
            unset($object->ds_fields[$key]);            
          }      	        
	      }  
      }

Disregard this patch. Reason is that I uploaded the wrong patch

vtsan’s picture

StatusFileSize
new13.6 KB

This is the correct patch.

ManyNancy’s picture

Status: Needs work » Needs review
vtsan’s picture

StatusFileSize
new9.46 KB

Updated my patch to work with ds 1.4.

Shadlington’s picture

Sub'ing

For the record, CCK-3.x (the version with multigroups in it) has an alpha release now.

syntheticMedia’s picture

Hello

Thanks for working on this patch. I have applied to 6.x-2.x-dev (from Feb 3rd). I am also using DS 1.4. When i applied the patch using netbeans, it said the patch was partially applied. I am now able to see content from the first multigroup which is better than before, but all other multigroup field sets are still blank. Any suggestions? Perhaps the patch needs to be updated to match the newest 6.x.2.x dev?

Edit- I reverted the .module back to the original 6.x-2.x-dev (Feb 3rd) (i.e. no patch applied), still getting only one multigroup fieldset to appear...

Anxiously awaiting any advice,

thanks!

vtsan’s picture

@everything27
The patch is intended for the latest DS 6.x-1.4 and should use with CCK 3.x branch which support multigroup.

varac’s picture

Version: 6.x-2.x-dev » 6.x-2.4

Any news on this ? I am waiting for this too....

At our site, nd-cck 6.x-2.4, ds 6.x-1.4, we can't get the patch working (see below).
Also, we are getting only one multigroup fieldset to appear too.

patch -p1 < ds_nd_cck_patch_version_1_4.patch
patching file sites/all/modules/ds/ds.module
Hunk #1 FAILED at 22.
Hunk #2 FAILED at 219.
Hunk #3 FAILED at 245.
Hunk #4 FAILED at 336.
Hunk #5 FAILED at 373.
Hunk #6 FAILED at 754.
6 out of 6 hunks FAILED -- saving rejects to file sites/all/modules/ds/ds.module.rej
patching file sites/all/modules/ds/theme/theme_ui.inc
Hunk #1 FAILED at 119.
Hunk #2 FAILED at 271.
2 out of 2 hunks FAILED -- saving rejects to file sites/all/modules/ds/theme/theme_ui.inc.rej
patching file sites/all/modules/nd_contrib/nd_cck/nd_cck.module
patching file sites/all/modules/nd_contrib/nd_cck/nd_cck.tpl.php

vtsan’s picture

I've just updated my patch for ds 6.x-1.x-dev to work with nd_cck in nd_contrib 6.x-2.x-dev.

swentel’s picture

I'm going to open a second branch for DS and a 3 branch for nd_contrib especially for multigroup support - will happen somewhere next week.

vtsan’s picture

Thanks swentel for the quick response.

R-H’s picture

Version: 6.x-2.4 » 6.x-2.x-dev
StatusFileSize
new58.36 KB
new48.34 KB
new95.35 KB

I'm having a problem with CCK multigroup and Node Display. Please see the attached. I have a mutligroup set up for an event (3 fields: interviewer, location, and date). In my node I currently have 2 events, but only the content for one is being displayed. The labels for both are being displayed, but only the content for the 1st is displayed. There is also another issue: similar fields are being displayed side-by-side. For example, both of the "Interviewer(s)" fields are being displayed next to each other. It would be better if the original order of the multigroup set was displayed (1. interview, 2. location, 3. date).

I hope the screen grabs help.

Using CCK 6.x-3.0-alpha3

R-H’s picture

StatusFileSize
new62.03 KB

I have applied the patch ds_and_nd_cck_to_support_cck_multigroup.patch in comment #38 above and it is fixed.

The patch was a little difficult to figure out how to apply. It assumes that your applying from /sites/all/modules but I actually have it in my local directory. I had to keep on telling the patch which module to apply to. The nice thing is that it gives you hints. It will say

The text leading up to this was:
--------------------------
|diff --git a/sites/all/modules/ds/theme/theme_ui.inc b/sites/all/modules/ds/theme/theme_ui.inc
|index 85a8cfc..ba8732b 100644
|--- a/sites/all/modules/ds/theme/theme_ui.inc
|+++ b/sites/all/modules/ds/theme/theme_ui.inc

Then it asks you which file to apply the patch to. So, choose theme.ui.inc in this case and it worked. It has to patch a bunch of files. Just supply the correct file name and your done.

Thanks for providing the patch.

R-H’s picture

StatusFileSize
new30.28 KB

I'm noticing that the label for the field group appears even if there are no values supplied for the field.

R-H’s picture

To clarify, even though there aren't any data below interview schedule, the label and even fieldset is still included in the html.

R-H’s picture

Any luck figuring out how to remove the display of fields that don't have a value?

danielbeeke2’s picture

thanks for the patch!

jstoller’s picture

@swentel: Any word on when this might make it into a release?

swentel’s picture

Priority: Critical » Normal

I created a 6.x-2.x for ds and 6.x-3.x branch for nd_contrib focussed on multigroup support - dev releases should be out within 12 hours.

It's been a while since I tested the patch, so I still think there are some notices in it, but haven't got much time to review right now. Hopefully someone else fixes those things. There is a separate branch for both, so go nuts :)

swentel’s picture

Status: Needs review » Fixed

Marking fixed. Create issue follow ups for any problems/notices.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

batigolix’s picture

from the release notes I understand that this is now implemented in nd_contrib 6.x-2.6
http://drupal.org/node/1340978