When I set multigroup to be displayed as Vertical Tab, it is displayed fine until I press "Add more values" button. When pressed, the button JS creates copy of multigroup outside of VT, and adds item to it, instead of adding new row to the multigroup in VT.
I don't put it in VT queue cause it works fine with CCK 2.x. Feel free to move it to VT queue if you think VT must change it's behaviour in some way.

Comments

crea’s picture

Title: "Add more" button breaks multigroup rendering inside Vertical Tab » "Add more" button breaks multigroup rendering as Vertical Tab

Setting proper title.

Also, it's worth to note, that when multigroup is rendered as fieldset inside vertical tab, "add more values" works fine. Because of this, and the fact other CCK "add more" buttons work fine inside Vertical Tab, I tend to think this is problem in content_multigroup JS which fails to find proper place to add item.

crea’s picture

Title: "Add more" button breaks multigroup rendering as Vertical Tab » "Add more" button breaks multigroup rendered as Vertical Tab
markus_petrux’s picture

I have installed Vertical Tabs to try to debug this, and I've found the problem, but I'm afraid this cannot be fixed in Content Multigroups module. Let's see...

Vertical Tabs searches for top level elements in the form that are fieldsets, and if enabled in Content Type settings form, it manages them in the node edit form. Here, Vertical Tabs moves the whole fieldset to a new position in the DOM.

The problem is that the fieldset used by multigroups is wrapped with a div that is necessary for the AHAH processing of the "Add more values" button. While Vertical Tabs moves the fieldset in the DOM, the AHAH wrapper of the multigroup remains in its original position, and this is what is replaced by the AHAH callback, so after the "Add more values" button has been processed, the form ends up with 2 multigroups (the one that was moved by Vertical Tabs to its new position and the one that comes from the AHAH response).

The multigroup module cannot move this wrapper inside the fieldset because both things are part of the same form element. Well, I cannot see a reliable way to do it from content_multigroup_add_more_js().

On the other hand, maybe the Vertical Tabs module could take this into account and process the fieldset wrapper (not the fieldset itself, but its wrapper) when it is related to AHAH stuff?

markus_petrux’s picture

Title: "Add more" button breaks multigroup rendered as Vertical Tab » "Add more" button breaks Content Multigroup rendered as Vertical Tab
Project: Content Construction Kit (CCK) » Vertical Tabs
Version: 6.x-3.x-dev » 6.x-1.x-dev
Component: content_multigroup.module » Code

Moving to the VT queue, as I think this cannot be done in multigroups module. On the other hand, VT would have to move the DOM element used to wrap the fieldset instead of the fieldset itself.

markus_petrux’s picture

Another thing VT could do is inject its own wrapper to the fieldset during hook_form_alter(), using #prefix and #suffix, and then it could manipulate this DOM element instead of altering the elements owned by other modules, because it is now breaking Content Multigroup, but it could probably break others.

markus_petrux’s picture

Title: "Add more" button breaks Content Multigroup rendered as Vertical Tab » Vertical Tabs breaks Content Multigroup when "Add more values" button is processed
crea’s picture

Title: Incompatability with CCK fieldsets and multigroups » Vertical Tabs breaks Content Multigroup when "Add more values" button is processed
Status: Postponed » Active
Issue tags: -User interface, -vertical tabs, -compatibility, -cck3, -multigroups, -vt

[edit] pls ignore this. It was wrong solution.

EHA’s picture

Subscribing

I would really like this functionality with VT and multigroups for my custom node forms. netaustin placed a patch for tabs.module for fieldgroup_tabs to work with multigroups, maybe some of the code can be used as seed for this issue. See here http://drupal.org/node/590386.

Would appreciate it crea if you could share patch or module solution you described above.

crea’s picture

Patch is not possible since it's custom solution related to my site. It would be possible to make this as independent module, but I won't waste time doing it cause it can (and should) be fixed in VT module at any moment. Instructions I posted are enough to make your custom workaround. If you can't program, sorry, you have to wait for bugfix.

bomarmonk’s picture

Confirming this problem in the latest vertical tabs release and that this still needs to be fixed. Can vertical tabs include official compatibility for multigroups? Thank you!

dave reid’s picture

I don't use CCK Multigroup so it will require someone to submit a patch and others to review it.

dave reid’s picture

Status: Active » Postponed (maintainer needs more info)

Please test and re-confirm using the latest code, 6.x-1.0-beta6.

bomarmonk’s picture

I just upgraded to the latest release, updated the database and I get the following error Fatal error: Call to undefined function vertical_tabs_fieldsets() in /home/gov/mysite/WWW/mysite.com/sites/all/modules/vt_default/vt_default.module on line 58

dave reid’s picture

That's a problem with the vt_default.module. Please open a new issue at http://drupal.org/project/issues/vt_default

crea’s picture

I tried beta6 and bug is still there...copy of multigroup is created outside of VT when "add more" is pressed.

bomarmonk’s picture

Confirming that duplicate display bug is still there (and my vt-default problem is now fixed in that project-- sorry about the stray issue)

crea’s picture

Status: Postponed (maintainer needs more info) » Active
bomarmonk’s picture

StatusFileSize
new47.27 KB

Here is a screen-shot of the cck fieldset (a multigroup) on the edit form. When selecting "Add more values" the fieldset is still rendered a second time on the page and outside the vertical tabs display. What other information can I supply you in order to help?

dave reid’s picture

Title: Vertical Tabs breaks Content Multigroup when "Add more values" button is processed » Incompatability with CCK fieldsets and multigroups
Status: Active » Postponed (maintainer needs more info)

Can someone type out a list of specific instructions to create this CCK field/multigroup so I can duplicate this?

bomarmonk’s picture

Go to http://drupal.org/project/cck and select "View all releases." Download cck 6.x-3.x-dev and install it in your Drupal 6 test environment. Download and install the latest vertical tabs module and be sure that it and the content multigroup module are enabled. Create a content type and add a new group for your content type, but choose multigroup instead of the standard group. Add some fields to this multigroup (in my case I'm using only two text fields to test). Then save your content type. Try creating this content type with this multigroup in a vertical tab on the edit form. Click "add another" below the first set of fields, and prang, you should see the duplicated fields on the node edit screen. I hope that helps!

dave reid’s picture

Priority: Normal » Minor
Status: Postponed (maintainer needs more info) » Active

Ah, that's why I was so frustrated trying to figure it out. I use the DRUPAL-6--2 branch of CCK on my dev install. Ok this is not a very high priority since there isn't even a download to use CCK 6.x-3.x yet (have to checkout from CVS).

dave reid’s picture

Priority: Minor » Normal

Ok I've figured out what's going wrong here. The multigroup element has set a $element['#prefix'] and $element['#suffix']

to help attach the new content. This div is not being moved inside the vertical tab, so therefore it attaches the new form inside the out-of-vertical-tabs div.

This may require backporting the D7 vertical tabs JavaScript so that the actual fieldsets are not modified.

dave reid’s picture

Status: Active » Postponed

Haha, yeah this needs to be fixed in D7 as well. Things go horribly wrong with #prefix and #suffix. Created a core bug report at #656580: Fields with #prefix and #suffix fail miserably with vertical tabs. Until then, I don't know how to best fix this.

bomarmonk’s picture

Is there a temporary workaround that will fix this for vertical tabs in Drupal 6? Multigroup (CCK 3.x-dev) is being widely used, as I understand it, and the multiple fields through multigroup are more important than having vertical tabs. I may just have to disable vertical tabs and let my user interface suffer as a result :( Anyway, thanks for looking into this, anyone; I like these vertical tabs.

dave reid’s picture

No, there's no workaround. Its a bug that'll need to be fixed by brighter minds since there is the same problem in core as well.

crea’s picture

Title: Vertical Tabs breaks Content Multigroup when "Add more values" button is processed » Incompatability with CCK fieldsets and multigroups
Status: Active » Postponed

[edit] ignore this

iwryanb’s picture

subscribed. also hoping for a workaround or fix.

Canine Coaches’s picture

subscribing. vertical tabs is awesome, but I am using multigroups. cannot code, but willing to test.

Chris

3dloco’s picture

kleinmp’s picture

StatusFileSize
new2.28 KB

I have a solution that solved the problem for me when using multigroups with vertical tabs.

I'm posting the patch, but please note that this is only a fix for the issue with multigroups (doesn't fix the more general prefix, suffix problem). Also, note that this is sort of hacky, and is really only a temporary solution.

sethhavens’s picture

subscribing

dgastudio’s picture

+1

seancorrales’s picture

Hacky or not, the patch posted in #31 worked great. Thanks!

tim.plunkett’s picture

Patch at #31 didn't work for me. Subscribing and waiting for #656580: Fields with #prefix and #suffix fail miserably with vertical tabs.

5t4rdu5t’s picture

Solved the problem completely. Patch #31 worked like charm for me. Thanks a lot! :-)

k8’s picture

I had a problem after upgrading to 6.x-1.0-rc1 where a Standard Group would only display in a vertical tab even through set as "always open" as desired. It was unclear to me which version Patch #31 applied to.
Falling back to 6.x-1.0-beta7 resolved the problem. Vertical tabs does not show as an option which is fine.

damienmckenna’s picture

Am running into this too :-\

damienmckenna’s picture

Another issue:

  • Edit a content type (admin/content/node-type/post/fields).
  • Create a fieldgroup.
  • On the content type main edit page (admin/content/node-type/post), set the new fieldgroup to be displayed in a vertical tab.
  • Go back to the fieldgroup settings page (admin/content/node-type/post/groups/group_testing).
  • The field's "style" will still say "Always open" rather than "Vertical tab".
crea’s picture

#31 works for me with beta6 (had to manually apply 1 chunk).

Taxoman’s picture

Subscribing.

henrijs.seso’s picture

Subscribing.

#31 works, but removes padding and vertical tab contents fill all tab, probably manageable with css.

crea’s picture

Just want to note that I'm no longer using a workaround I posted in #7. It turned out to be wrong solution causing different issues with form processing.
I switched to the patch in #31

henrijs.seso’s picture

Is it just me, or patch #31 acts wired. I get empty fieldset with no legend above multigroup before clicking on 'Add more items' and proper fieldset with legend after?

NathanM’s picture

Subscribing. Would love to see this fixed & committed.

fowlerjb’s picture

After installing Vertical Tabs 6x-1.x-dev I applied the patch from #31. It does work. When using multigroups I was able to add the new value; however in edit mode I was presented with 2 instances of the multigroup, one with the new field to add the new value, the other with the group as was before editing. I added the new value, clicked save and it worked. Going back to the view mode the multigroup appeared properly. Other than the confusion that might be caused by the user seeing 2 instances of the multigroup when in edit mode I am happy with the patch.

blakehall’s picture

Having the same issue here. (With the patch in #31 mostly working)

drupalnesia’s picture

Subscribing, more than 1 year but still no committed path?
I have tested 6.x-1.0-rc1 and 6.x-1.x-dev but still error. Multigroups is very important feature for Drupal.

Vote_Sizing_Steve’s picture

Patch #31 works for me, fairly well. However, it would be much better for my site if the multigroup wasn't treated as a vertical tab, but as a nested group inside the other vertical tabs.

jstoller’s picture

subscribing

I agree with #49. I would like to put my multigroup in another tab, rather than have it be its own tab.

jstoller’s picture

Problem solved!

I've been testing the CCK patch at #849420: Cumulative Nested Fieldgroup Patches and so far it seems to work beautifully. It lets you put a multigroup inside a standard group, which prevents vertical tabs from messing with it. This also means you could group other fields with the multigroup in that same tab.

grndlvl’s picture

Issue summary: View changes
StatusFileSize
new1.88 KB

Re-rolling so automated patches.make applies patch without hassle.

jvieille’s picture

The patch does not do anything actually.